abdo meghari
Active Member
- Joined
- Aug 3, 2021
- Messages
- 465
- Office Version
- 2019
Hi
I want populating headers in combobox on userform based on headers in row1 for sheet2 and skip any column contains header ITEM (should not populate any column contains header ITEM into combobox) with considering should populate automatically when add new header by insert new column into combobox .
this is what I want to modify it .
Thanks
I want populating headers in combobox on userform based on headers in row1 for sheet2 and skip any column contains header ITEM (should not populate any column contains header ITEM into combobox) with considering should populate automatically when add new header by insert new column into combobox .
this is what I want to modify it .
VBA Code:
Private Sub UserForm_Initialize()
Dim ws As Worksheet
Dim d As Object
Dim x
Set d = CreateObject("scripting.dictionary")
d.CompareMode = vbTextCompare
Set ws = Sheets("sheet2")
For Each x In .Range("A1:D1" & .Cells(Rows.Count, "A").End(xlUp).Row).Value
d(x) = Empty
Next
Me.ComboBox1.List = d.Keys
End Sub