Populating sheet names in combobox

  • Thread starter Thread starter Todd Huttenstine
  • Start date Start date
T

Todd Huttenstine

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
 
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
 
Back
Top