Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ComboBox WorkSheet Trouble

Hello

Im trying to add the name of each worksheet to a combobox but so far I'm
having little luck, I want it to be done in this style:

sub userform_initialize()

For x = 1 to 30

combobox1.additem sheet & x.name

next x

end sub

This can't be far out but it doesn't work, does anyone know how to do this

--
Message posted via http://www.officekb.com
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default ComboBox WorkSheet Trouble

sub userform_initialize()
dim x as long
For x = 1 to activeworkbook.sheets.count
combobox1.additem activeworkbook.sheets(x).name
next x
end sub

Or

sub userform_initialize()
dim wks as worksheet
For each wks in activeworkbook.worksheets
combobox1.additem wks.name
next wks
end sub

"Beginner via OfficeKB.com" wrote:

Hello

Im trying to add the name of each worksheet to a combobox but so far I'm
having little luck, I want it to be done in this style:

sub userform_initialize()

For x = 1 to 30

combobox1.additem sheet & x.name

next x

end sub

This can't be far out but it doesn't work, does anyone know how to do this

--
Message posted via http://www.officekb.com


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default ComboBox WorkSheet Trouble

Excellent

Thanks Mate

--
Message posted via http://www.officekb.com
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
Trouble with a ComboBox on a UserForm ryguy7272 Excel Discussion (Misc queries) 1 February 20th 08 09:02 PM
Trouble with a ComboBox on a UserForm ryguy7272 Excel Worksheet Functions 1 February 19th 08 07:41 AM
worksheet trouble Toro Excel Worksheet Functions 1 March 8th 07 08:32 PM
big trouble with combobox/vlookup soulfear Excel Discussion (Misc queries) 1 May 11th 06 07:55 AM
Copying Worksheet triggers Click event of combobox on another worksheet Robert[_20_] Excel Programming 0 January 23rd 04 07:40 PM


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