LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 2 comboboxs, different sheet references

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("D2:D5"). 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 he

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sheet references pablo bellissimo Excel Discussion (Misc queries) 8 March 24th 09 04:57 AM
Creating sheet references Mats Samson Excel Worksheet Functions 4 September 28th 07 04:37 PM
Modification of sheet references Jonathan Oz Excel Discussion (Misc queries) 3 March 31st 07 04:20 AM
relative sheet references ala sheet(-1)!B11 so I can copy a sheet. RonMc5 Excel Discussion (Misc queries) 9 February 3rd 05 12:51 AM
How do I create a button to reset ComboBoxs noirnor Excel Programming 5 September 10th 03 01:55 AM


All times are GMT +1. The time now is 03:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"