Hello ,
I've found code for Dante Amore and I modified based on my requirements but I face some problems !
first when populate items in combobox1,2,3,4 will show empty among items because there are empty cells among cells in sheets . so how delete any empty in combobox1,2,3,4?
second I would change implementation from one sheet to multiple sheet by put specific sheets in array("SH","REPORT","FINAL")
the original code just deal with SH sheet how make it to deal with specific sheets?
I hope finding help to fixing the code.
thanks.
I've found code for Dante Amore and I modified based on my requirements but I face some problems !
first when populate items in combobox1,2,3,4 will show empty among items because there are empty cells among cells in sheets . so how delete any empty in combobox1,2,3,4?
second I would change implementation from one sheet to multiple sheet by put specific sheets in array("SH","REPORT","FINAL")
the original code just deal with SH sheet how make it to deal with specific sheets?
VBA Code:
Dim a As Variant
Private Sub UserForm_Activate()
Dim dic1 As Object, dic2 As Object , dic3 As Object, dic4 As Object
Dim i As Long
Set dic1 = CreateObject("Scripting.Dictionary")
Set dic2 = CreateObject("Scripting.Dictionary")
Set dic3 = CreateObject("Scripting.Dictionary")
Set dic4 = CreateObject("Scripting.Dictionary")
a = Sheets("SH").Range("A1:G" & Sheets("SH").Range("G" & Rows.Count).End(3).Row).Value
With ListBox1
.RowSource = ""
.ColumnWidths = "100;100;100;130;80,80,80"
.ColumnCount = 7
.Font.Size = 10
End With
For i = 2 To UBound(a, 1)
dic1(a(i, 2)) = Empty
dic2(a(i, 3)) = Empty
dic3(a(i, 4)) = Empty
dic4(a(i, 6)) = Empty
Next
ComboBox1.List = dic1.keys
ComboBox2.List = dic2.keys
ComboBox3.List = dic3.keys
ComboBox4.List = dic4.keys
End Sub
thanks.