Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Setup ComboBox when open workbook

Hi,

I want to fill a ComboBox with items when I open the Workbook.
But I don't want to take the items from cells in the worksheet.
So I tried these lines:

Private Sub Workbook_Open()
ComboBox1.List = Array("First", "Second", "Third", "Forth")
End Sub

But this does not work.
What is missing.

Thanks in advance,
/Sören

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Setup ComboBox when open workbook

It probably doesn't know where the combo box is

Private Sub Workbook_Open()
Worksheets("Sheet1").ComboBox1.List = Array("Item1", "Item2", "Item3")
End Sub

"Sören_Marodören" wrote:

Hi,

I want to fill a ComboBox with items when I open the Workbook.
But I don't want to take the items from cells in the worksheet.
So I tried these lines:

Private Sub Workbook_Open()
ComboBox1.List = Array("First", "Second", "Third", "Forth")
End Sub

But this does not work.
What is missing.

Thanks in advance,
/Sören

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 196
Default Setup ComboBox when open workbook

Hi Soren

If your combobox is located on sheet1 say, then try prefixing the
combobox statement with the location ie:

Private Sub Workbook_Open()
Sheets("Sheet1").ComboBox1.List = Array("First", "Second",
"Third", "Forth")
End Sub

Hope this helps!

Richard


On 31 Jan, 08:53, Sören_Marodören
wrote:
Hi,

I want to fill a ComboBox with items when I open the Workbook.
But I don't want to take the items from cells in the worksheet.
So I tried these lines:

Private Sub Workbook_Open()
ComboBox1.List = Array("First", "Second", "Third", "Forth")
End Sub

But this does not work.
What is missing.

Thanks in advance,
/Sören



Reply
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
How to setup Excel Template to open in Outlook 2003 in body William (Bill) C. Earl Setting up and Configuration of Excel 0 September 30th 08 12:56 AM
Error 1402. Setup cannot open the registry key. Jack and Jill Excel Discussion (Misc queries) 1 May 6th 06 09:31 AM
Print setup of a complete workbook I Rygert Excel Discussion (Misc queries) 1 March 22nd 06 08:44 AM
Define Page Setup for whole workbook AliH Excel Programming 1 August 9th 05 05:16 PM
Workbook window setup greg malenky Excel Programming 1 April 27th 05 02:19 PM


All times are GMT +1. The time now is 10:38 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"