Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 211
Default How to populate a combobox with the name of all the sheets in work

Hi,

I'm struggling with this one. Can anyone help me.

Thanks
Gordon
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How to populate a combobox with the name of all the sheets in work

for each sh in thisworkbook.worksheets
listbox1.AddItem sh.name
Next

--
Regards,
Tom Ogilvy

"Gordon" wrote in message
...
Hi,

I'm struggling with this one. Can anyone help me.

Thanks
Gordon



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default How to populate a combobox with the name of all the sheets inwork

Hi,

for each sh in activeworkbook.sheets
me.combobox1.additem sh.name
next




Gordon a écrit :
Hi,

I'm struggling with this one. Can anyone help me.

Thanks
Gordon

  #4   Report Post  
Posted to microsoft.public.excel.programming
jai jai is offline
external usenet poster
 
Posts: 71
Default How to populate a combobox with the name of all the sheets in

Hi,
I too am struggling with a similar problem. I have created a form that is
required to pop up and ask for user input on the particular field to use for
some processing. Rather than have the user type in a field name and then
vaildate it, I would like to launch a user form with a combo box in which the
list of fields is pre-loaded using the combobox.AddItem method and then allow
the user to choose one of them.

At what point can I populate the combo box list? The combo box appears to
"get live" the moment the form initialization takes place and so the list add
item does not happen before the combo box comes to life. How do I do this?

I saw an example using calls to a dynamic library using cbo.AddItem.
Could this be elaborated upon please ?

Many thanks

Jai

"anonymousA" wrote:

Hi,

for each sh in activeworkbook.sheets
me.combobox1.additem sh.name
next




Gordon a écrit :
Hi,

I'm struggling with this one. Can anyone help me.

Thanks
Gordon


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 296
Default How to populate a combobox with the name of all the sheets in

Put your .addItem...... code in the Activate event of the form.

Alternatively if you have the items in a range of cells in the
workbook, you could set the RowSource property of the combo box to
point to the list. This avoids having to update the VBA code whenever
you have a new item.

HTH


On Sat, 29 Oct 2005 10:30:03 -0700, Jai
wrote:

Hi,
I too am struggling with a similar problem. I have created a form that is
required to pop up and ask for user input on the particular field to use for
some processing. Rather than have the user type in a field name and then
vaildate it, I would like to launch a user form with a combo box in which the
list of fields is pre-loaded using the combobox.AddItem method and then allow
the user to choose one of them.

At what point can I populate the combo box list? The combo box appears to
"get live" the moment the form initialization takes place and so the list add
item does not happen before the combo box comes to life. How do I do this?

I saw an example using calls to a dynamic library using cbo.AddItem.
Could this be elaborated upon please ?

Many thanks

Jai

"anonymousA" wrote:

Hi,

for each sh in activeworkbook.sheets
me.combobox1.additem sh.name
next




Gordon a écrit :
Hi,

I'm struggling with this one. Can anyone help me.

Thanks
Gordon



__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________


  #6   Report Post  
Posted to microsoft.public.excel.programming
jai jai is offline
external usenet poster
 
Posts: 71
Default How to populate a combobox with the name of all the sheets in work

Hi Gordon,
Thanks. Iwas putting the code in the Initialize event and got stuck. I
have tried the row source route earlier, but this time the list items are
coming from different workbooks and so this may not be so elegant though I am
sure it will work.

Thanks once again.

"Gordon" wrote:

Hi,

I'm struggling with this one. Can anyone help me.

Thanks
Gordon

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 do i populate a text box according to selection in combobox? Steve Excel Worksheet Functions 0 April 13th 06 12:40 PM
Populate combobox Pat Excel Programming 1 December 10th 04 05:33 PM
populate combobox with sheet names David Goodall Excel Programming 3 September 12th 04 12:37 PM
populate combobox with sheet names David Goodall Excel Programming 0 September 12th 04 08:55 AM
Populate a combobox Rory[_3_] Excel Programming 2 June 9th 04 04:20 PM


All times are GMT +1. The time now is 01:57 AM.

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

About Us

"It's about Microsoft Excel"