Hidden worksheets

  • Thread starter Torbjörn Steijer
  • 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
 
R

Ron de Bruin

Try this

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top