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: 1
Default Workbook_Open and ComboBox

I want to run the following code when my worksheet is open:
---------------------
Sheets("Event Setup").Activate
'Clear ListBox
For Count = 1 To ComboBox1.ListCount
ComboBox1.RemoveItem (0)
Next
ComboBox1.AddItem ("<Select Vendor")

NumberOfVendors = Range("NumberOfVendors").Value
Count = 1
Do While (NumberOfVendors = Count)
VendorName = Range("E" & Count).Value
MsgBox (VendorName)
ComboBox1.AddItem (VendorName)
Count = Count + 1
Loop
ComboBox1.ListIndex = 0
------------------------------

I put it in a Workbook_Open macro, but get an error:
"object required: on the ComboBox1.ListCount line.

How can I run this code when my workbook is opened?



 
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
fill combobox depending on selection from another combobox Adam Francis Excel Discussion (Misc queries) 2 July 24th 08 07:39 PM
Workbook_Open () Bill Martin Excel Discussion (Misc queries) 12 December 20th 05 05:37 PM
How Do I Load A ComboBox RowSource From The Results Of Another ComboBox Minitman[_4_] Excel Programming 3 October 26th 04 07:58 PM
Help with Workbook_Open Ruan[_3_] Excel Programming 7 April 28th 04 07:52 AM
Workbook_Open event and combobox state storage question jw Excel Programming 0 October 23rd 03 12:44 AM


All times are GMT +1. The time now is 11:02 PM.

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"