Posted By

cueballrawn on 06/13/16


hide excel vba prefix specific worksheets

Versions (?)

Excel (VBA) hide specific worksheets

 / Published in: Visual Basic

Hide specific worksheets in a workbook that contain a prefix. This example uses "Admin_", although this can be changed easily.

  1. Sub HideAdminSheet()
  2. Dim ws As Worksheet
  4. For Each ws In ActiveWorkbook.Worksheets
  5. If Left(ws.Name, 6) = "Admin_" Then
  6. ws.Visible = xlSheetHidden
  7. End If
  8. Next ws
  10. End Sub

Report this snippet  

You need to login to post a comment.