ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Populating listbox with sheet names (https://www.excelbanter.com/excel-discussion-misc-queries/187710-populating-listbox-sheet-names.html)

JohnB

Populating listbox with sheet names
 
Can I populate a listbox with worksheet names but skip the first sheet
(sheet1)?

Dave Peterson

Populating listbox with sheet names
 
Is this a listbox on a userform?

If yes, you could use something like this in the _initialize routine.

Dim iCtr as long
for ictr = 2 to activeworkbook.worksheets.count
me.listbox1.additem activeworkbook.worksheets(ictr).name
next ictr



johnb wrote:

Can I populate a listbox with worksheet names but skip the first sheet
(sheet1)?


--

Dave Peterson


All times are GMT +1. The time now is 08:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com