PGSystemTester

VBA subroutine to make all named ranges visible in Excel

Jul 12th, 2017
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub unhideNamedRanges()
  2. Const UNHIDE As Boolean = True 'Set this to True if you want to unhide everything. Set = False to hide.
  3.  
  4. Dim N As Name
  5.  
  6. For Each N In ThisWorkbook.Names
  7.    If N.Visible = Not (UNHIDE) Then
  8.         N.Visible = UNHIDE
  9.     End If
  10.  
  11. Next N
  12.  
  13. 'Use this if you only want to look at items attached to sheets.
  14. 'Dim wks As Worksheet
  15. 'For Each wks In ThisWorkbook.Sheets
  16. '    For Each N In wks.Names
  17. '        If N.Visible = Not (UNHIDE) Then
  18. '            N.Visible = UNHIDE
  19. '        End If
  20. '    Next N
  21. 'Next wks
  22.  
  23. End Sub
Add Comment
Please, Sign In to add comment