K
Kryer
I have a userform that has 2 comboboxs, I want combobox1 to populate from
Sheet1, range("A2:A100") and i want combobox2 to populate from sheet2,
range("D25"). But when I do that it wont populate the combox values if I am
on sheet3. Then if i am on sheet2 only combobox2 values appear and etc.. what
is wrong with my code here:
Private Sub UserForm_Initialize()
Dim sh As Worksheet
Dim rng As Range
Dim MyArray() As Variant
Dim sh1 As Worksheet
Dim rng1 As Range
Dim MyArray1() As Variant
Set sh = Workbooks("Medical Bills.xls").Worksheets("DocInfo")
Set rng = Range("A2:A100")
MyArray = rng
ComboBox1.List = MyArray
Set sh1 = Workbooks("Medical Bills.xls").Worksheets("Titles")
Set rng1 = Range("B1:B5")
MyArray1 = rng1
ComboBox2.List = MyArray1
End Sub
Please help
Sheet1, range("A2:A100") and i want combobox2 to populate from sheet2,
range("D25"). But when I do that it wont populate the combox values if I am
on sheet3. Then if i am on sheet2 only combobox2 values appear and etc.. what
is wrong with my code here:
Private Sub UserForm_Initialize()
Dim sh As Worksheet
Dim rng As Range
Dim MyArray() As Variant
Dim sh1 As Worksheet
Dim rng1 As Range
Dim MyArray1() As Variant
Set sh = Workbooks("Medical Bills.xls").Worksheets("DocInfo")
Set rng = Range("A2:A100")
MyArray = rng
ComboBox1.List = MyArray
Set sh1 = Workbooks("Medical Bills.xls").Worksheets("Titles")
Set rng1 = Range("B1:B5")
MyArray1 = rng1
ComboBox2.List = MyArray1
End Sub
Please help