If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > working with a combo box in sheet 1

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-19-06, 14:45
MikeroSoft MikeroSoft is offline
Registered User
 
Join Date: Apr 2006
Posts: 47
working with a combo box in sheet 1

I have a cbo in sheet 1 called cboSelect. I would like to write code in a module that will fire when the file is opened, but dont know how i can run code in a module that will run from the workbook open even and fill a combo box in sheet 1

(thisworkbook)
Private Sub Workbook_Open()
FillCbo 'This will be in module1 of the current worksheet
End Sub

(module1)
Sub FillCbo()
Dim i As Integer

For i = 2 To Sheets("SYMBOL TABLE").UsedRange.Rows.Count
cboSelect.AddItem (Sheets("SYMBOL TABLE").Range("A" & i).Value)
Next
End Sub
Reply With Quote
  #2 (permalink)  
Old 06-19-06, 19:04
spikey_richie spikey_richie is offline
Registered User
 
Join Date: Jun 2006
Location: Colton, CA
Posts: 26
So which part doesn't work?
__________________
Geek it till it mHz
Reply With Quote
  #3 (permalink)  
Old 06-19-06, 20:46
mikezcg mikezcg is offline
Registered User
 
Join Date: Oct 2003
Posts: 311
Actually i figured it out i need to qualify code in modeule1 : Module1****nThis and all references to the combo box need to be qualified by the sheet :
sheets(1).CboSelect.addItem("New item")


Thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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