Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Initializing User Forms
You don't need to go through two arrays to do this:
Private Sub fmPickStore_Initialize() cbStoreList.ColumnCount = 2 cbStoreList.List = _ ThisWorkbook.Worksheets("Chart Data").Range("b3:c22").Value End Sub If you only want to load 1 column Private Sub fmPickStore_Initialize() cbStoreList.List = _ ThisWorkbook.Worksheets("Chart Data").Range("B3:B22").Value End Sub -- Regards, Tom Ogilvy "Marcotte A" wrote in message ... I am having trouble initializing my user forms. I have a drop down list that I want populated from a range on my spreadsheet. When that spreadsheet is not active, the combobox doesn't get initialized. This is the initialize code. I thought the 'ThisWorkbook' part would take care of it, but it doesn't seem to. What am I doing wrong? Private Sub fmPickStore_Initialize() Dim varStoreList As Variant Dim arrStoreList(20, 2) As Variant Dim i As Integer varStoreList = ThisWorkbook.Worksheets("Chart Data").Range("b3:c22") For i = 1 To 20 arrStoreList(i, 1) = varStoreList(i) Next i cbStoreList.List = arrStoreList End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
user forms | Excel Discussion (Misc queries) | |||
User Forms | Excel Discussion (Misc queries) | |||
user forms | Excel Discussion (Misc queries) | |||
User forms | Excel Programming | |||
User forms in VBA | Excel Programming |