Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 237
Default Populating sheet names in combobox

What is the code to display sheet names in a combobox? I
need it to display every sheet after Worksheets(4). This
means I need it to display the 5th sheet and beyond. If
there are only 4 sheets and no sheet5, then I need for
nothing to be displayed in the combobox.

Thanx

Todd Huttenstine
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Populating sheet names in combobox

for i = 5 to sheets.count
listbox1.AddItem sheets(i).Name
Next

--
Regards,
Tom Ogilvy


Todd Huttenstine wrote in message
...
What is the code to display sheet names in a combobox? I
need it to display every sheet after Worksheets(4). This
means I need it to display the 5th sheet and beyond. If
there are only 4 sheets and no sheet5, then I need for
nothing to be displayed in the combobox.

Thanx

Todd Huttenstine



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 237
Default Populating sheet names in combobox

Thank you

-----Original Message-----
for i = 5 to sheets.count
listbox1.AddItem sheets(i).Name
Next

--
Regards,
Tom Ogilvy


Todd Huttenstine

wrote in message
...
What is the code to display sheet names in a combobox?

I
need it to display every sheet after Worksheets(4).

This
means I need it to display the 5th sheet and beyond. If
there are only 4 sheets and no sheet5, then I need for
nothing to be displayed in the combobox.

Thanx

Todd Huttenstine



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Populating sheet names in combobox

Todd,

Try something like the following:

Dim N As Long
With Me.ListBox1
.Clear
For N = 5 To ThisWorkbook.Worksheets.Count
.AddItem ThisWorkbook.Worksheets(N).Name
Next N
End With

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Todd Huttenstine" wrote in
message ...
What is the code to display sheet names in a combobox? I
need it to display every sheet after Worksheets(4). This
means I need it to display the 5th sheet and beyond. If
there are only 4 sheets and no sheet5, then I need for
nothing to be displayed in the combobox.

Thanx

Todd Huttenstine



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
Transpose technique not populating ListFillRange of ActiveX combobox JimC[_2_] Excel Discussion (Misc queries) 2 September 6th 08 01:07 PM
.AddItem list and populating combobox with created list pallaver Excel Discussion (Misc queries) 8 June 27th 08 12:36 PM
Populating listbox with sheet names johnb Excel Discussion (Misc queries) 1 May 16th 08 12:33 PM
Combobox populating based on Option Button Todd Huttenstine[_2_] Excel Programming 7 November 9th 03 10:18 PM
populating a combobox on a worksheet Tim Marsh[_2_] Excel Programming 2 November 3rd 03 12:44 PM


All times are GMT +1. The time now is 04:03 PM.

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"