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: 27,285
Default 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
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
user forms Obi-Wan Kenobi Excel Discussion (Misc queries) 0 March 21st 06 08:28 PM
User Forms Runner77 Excel Discussion (Misc queries) 1 January 12th 06 06:20 AM
user forms Runner77 Excel Discussion (Misc queries) 0 January 12th 06 04:31 AM
User forms eklarsen[_7_] Excel Programming 5 May 17th 04 05:36 AM
User forms in VBA Dick Kusleika Excel Programming 0 September 29th 03 05:55 PM


All times are GMT +1. The time now is 05:21 AM.

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

About Us

"It's about Microsoft Excel"