Hi,
I would populate items in combobox2 based on selected item from combobox1 , the header in combobox1 matchs based on header for row1 inside sheet.
example :if the Selected item from combobox1 is Cust then will match with header inside sheet and populate items in combobox2 based on selected header in combobox1 . so should show :
MLLK
MLKLL
KMML
but if it's possible I don't need duplicates items .
I have code but I need correcting.
I will add new columns so header will increase in combobox1
Private Sub ComboBox1_Change()
Application.ScreenUpdating = False
Dim LastRow As Long, header As Range, foundHeader As Range, lCol As Long, srcWS As Worksheet
Set srcWS = Sheets("ppr")
LastRow = srcWS.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
lCol = srcWS.Cells(1, Columns.Count).End(xlToLeft).Column
For Each header In srcWS.Range(srcWS.Cells(1, 1), srcWS.Cells(1, lCol))
Set foundHeader = srcWS.Rows(1).Find(header, LookIn:=xlValues, lookat:=xlWhole)
If ComboBox1 = foundHeader Then
ComboBox2.Value = srcWS.Cells(LastRow, foundHeader.Column)
End If
Next header
Application.ScreenUpdating = True
End Sub
thanks