ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hidden worksheets (https://www.excelbanter.com/excel-programming/281368-hidden-worksheets.html)

Torbjörn Steijer

Hidden worksheets
 
I have a workbook where I want to hide sheets but make them available via a
Userform. I have an old procedure listing all sheets in a workbook but I
would like to filter out only those beginning with "Test"

wb = ActiveWorkbook.Name
Range("A1").Select

For Each ws In Workbooks(wb).Sheets
ActiveCell.Value = ws.Name
ActiveCell.Offset(1, 0).Select
Next

How can I change the code to do what I want?

Best regards,

Torbjörn



Ron de Bruin

Hidden worksheets
 
Try this

If Left(ws.Name, 4) = "Test" Then
ActiveCell.Value = ws.Name
ActiveCell.Offset(1, 0).Select
End If


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Torbjörn Steijer" wrote in message ...
I have a workbook where I want to hide sheets but make them available via a
Userform. I have an old procedure listing all sheets in a workbook but I
would like to filter out only those beginning with "Test"

wb = ActiveWorkbook.Name
Range("A1").Select

For Each ws In Workbooks(wb).Sheets
ActiveCell.Value = ws.Name
ActiveCell.Offset(1, 0).Select
Next

How can I change the code to do what I want?

Best regards,

Torbjörn






All times are GMT +1. The time now is 07:39 AM.

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