Hidden worksheets

  • Thread starter Thread starter Torbjörn Steijer
  • Start date Start date
T

Torbjörn Steijer

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
 
Try this

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