View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
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