hi expert
I no know where is the problem . it shows the headers in multiple comboboxes when search specific item . as to the code it will search from row2 , but in comboboxes also show header as in my pictue (CODE)is header
this is the code
any idea experts,please?
I no know where is the problem . it shows the headers in multiple comboboxes when search specific item . as to the code it will search from row2 , but in comboboxes also show header as in my pictue (CODE)is header
this is the code
VBA Code:
Private Sub UserForm_Initialize()
With Sheets("BRANDS")
With .Range("A2", .Cells(.Rows.Count, "A").End(xlUp))
For i = 1 To 4
Me.Controls("ComboBox" & i).List = .Offset(, i - 1).Value
Me.Controls("ComboBox" & i + 4).List = .Offset(, i - 1).Value
Me.Controls("ComboBox" & i + 8).List = .Offset(, i - 1).Value
Me.Controls("ComboBox" & i + 12).List = .Offset(, i - 1).Value
Me.Controls("ComboBox" & i + 16).List = .Offset(, i - 1).Value
Me.Controls("ComboBox" & i + 20).List = .Offset(, i - 1).Value
Me.Controls("ComboBox" & i + 24).List = .Offset(, i - 1).Value
Me.Controls("ComboBox" & i + 28).List = .Offset(, i - 1).Value
Me.Controls("ComboBox" & i + 32).List = .Offset(, i - 1).Value
Me.Controls("ComboBox" & i + 36).List = .Offset(, i - 1).Value
Me.Controls("ComboBox" & i + 40).List = .Offset(, i - 1).Value
Me.Controls("ComboBox" & i + 44).List = .Offset(, i - 1).Value
Next
End With
End With
End Sub
Private Sub ComboBox2_Change()
Dim c As Range
With Sheets("BRANDS")
Set c = .Range("B:B").Find(What:=ComboBox2.Value, LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
If Not c Is Nothing Then
ComboBox3.Value = c.Offset(, 1).Value
ComboBox4.Value = c.Offset(, 2).Value
ComboBox5.Value = c.Offset(, 3).Value
TextBox1.Value = c.Offset(, 4).Value
End If
End With
End Sub