View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Gary Keramidas Gary Keramidas is offline
external usenet poster
 
Posts: 2,494
Default Adding Sheets to a combo Box

you can get rid of the i=i+1 line, it was leftover from something else

--


Gary


"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
this should work

Sub test()

Dim SH As Worksheet
For Each SH In Worksheets
i = i + 1
ComboBox1.AddItem "test" & SH.Name
Next
End Sub


--


Gary


"David Pick" wrote in message
oups.com...
I am trying to a sheets to a combo box without knowing the number of
sheets. I have tried this code:

For Each Sheet in ThisWorkBook
cmbComboBox1.AddItem Sheet.Name
Next

Any Ideas. Thanks
-David