Hide rows macro issue

July 9, 2012 at 01:17:52
Specs: Windows XP
Hide rows formula works for 1 tab but not another

below is not working
Sub Hide_PA()
'
' Hide/Unhide Port Agency Sheet

If Range("L1") = False Then
Sheets("2013 Budget").Select
Application.Goto Reference:="PAr"
Selection.EntireRow.Hidden = True
Application.Goto Reference:="PAs"
Selection.EntireRow.Hidden = True
Sheets("Overview").Select
Range("A1").Select
Else
Sheets("2013 Budget").Select
Application.Goto Reference:="PAr"
Selection.EntireRow.Hidden = False
Application.Goto Reference:="PAs"
Selection.EntireRow.Hidden = False
Sheets("Overview").Select
Range("A1").Select
End If

End Sub

but next section does?
Sub Hide_SPA()
'
' Hide/Unhide Port Agency Strategy Sheet

If Range("K1") = False Then
Sheets("2014-2015 Strategy Plan").Select
Application.Goto Reference:="SPAr"
Selection.EntireRow.Hidden = True
Application.Goto Reference:="SPAs"
Selection.EntireRow.Hidden = True
Sheets("Overview").Select
Range("A1").Select
Else
Sheets("2014-2015 Strategy Plan").Select
Application.Goto Reference:="SPAr"
Selection.EntireRow.Hidden = False
Application.Goto Reference:="SPAs"
Selection.EntireRow.Hidden = False
Sheets("Overview").Select
Range("A1").Select
End If

End Sub

I have names the row to hide as a range name for 2 rows on each tab but it won't hide on the first tab.

Any help on resolving this would be greatly appreciated.
Thanks


See More: Hide rows macro issue

Report •

#1
July 9, 2012 at 06:17:02
Please click on the following line and read the instructions on how to post VBA code in this forum. Then repost your code so that it is easier to read. Thanks!

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •
Related Solutions


Ask Question