Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I'm using this piece of code to populate an excel userform listbox with the name of each worksheet in a workbook i = 1 For Each ws In Worksheets Worksheets.Select Sheets(i).Activate ListBox1.AddItem (ActiveSheet.Name) i = i + 1 Next ws Is there a better way I can do this as this visably activates each sheet each time the listbox is repopulated. Thanks ...pc |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
PC
For Each ws In ActiveWorkbook.Worksheets ListBox1.AddItem ws.Name Next ws -- Dick Kusleika Excel MVP Daily Dose of Excel www.dicks-blog.com PC wrote: Hi, I'm using this piece of code to populate an excel userform listbox with the name of each worksheet in a workbook i = 1 For Each ws In Worksheets Worksheets.Select Sheets(i).Activate ListBox1.AddItem (ActiveSheet.Name) i = i + 1 Next ws Is there a better way I can do this as this visably activates each sheet each time the listbox is repopulated. Thanks ..pc |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello PC, Paste this code into your program. I = 1 For Each ws In Worksheets ComboBox1.AddItem (Sheets(I).Name) I = I + 1 Next ws Hope this helps, Leith Ros -- Leith Ros ----------------------------------------------------------------------- Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846 View this thread: http://www.excelforum.com/showthread.php?threadid=34586 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
populate combobox with sheet names | Excel Programming | |||
populate combobox with sheet names | Excel Programming | |||
Populate cell values with sheet names | Excel Programming | |||
Populate cell values with sheet names | Excel Programming | |||
Populate combo box for Userform in Excel 2002 | Excel Programming |