hello I have this code but when I run the code I get error "control variable already in use" kindly help
>>> use code - tags <<<
>>> use code - tags <<<
Code:
Dim sh As Worksheet
Dim i As Long
Me.ListBox1.Clear
Set sh = Sheets("SG_Sheet1")
Me.ListBox1.AddItem
For a = 1 To 6
Me.ListBox1.List(0, a - 1) = sh.Cells(1, a)
Next a
Me.ListBox1.Selected(0) = True
For i = 2 To sh.Range("A1000000").End(xlUp).Offset(1, 0).Row
For j = 1 To 6
H = Application.WorksheetFunction.CountIf(sh.Range("A" & 2, "F" & i), _
sh.Cells(i, f))
If H = 1 And LCase(sh.Cells(i, f)) = LCase(Me.TextBox1) Or H = 1 And _
sh.Cells(i, f) = Val(Me.TextBox1) Then
For x = 1 To 6
Me.ListBox1.AddItem
For x = 1 To 6
Me.ListBox1.List(ListBox1.ListCount - 1, x - 1) = sh.Cells(i, x)
Next x
End If
Next j
Next i
Last edited by a moderator: