jpeters7635
New Member
- Joined
- Jul 28, 2021
- Messages
- 10
- Office Version
- 365
- Platform
- Windows
I have 2 macros - (Show_Hide) which hides and unhides the section by clicking a button, and another macro (BudgtComm) that only shows 2 non-contiguous rows within the section and only hides.
I'd like to combine these into one macro so that when I hit the button with all rows showing, the budgtcomm macro becomes the view, then click again and it hides the entire section, and then click again and it unhides to the budgtcomm view, and then click again and it unhides the whole section. I appreciate any help!
This is the one that shows and hides the whole section with one button:
_______________________________________________________________
Sub show_hide()
Rows("139:146").Select
If Selection.EntireRow.Hidden = True Then
Selection.EntireRow.Hidden = False
Else
Selection.EntireRow.Hidden = True
End If
End Sub
__________________________________________________________________
This one only shows only rows 139, 143, and 145 - 146
__________________________________________________________________
Sub BudgtComm()
Range("140:142,144:144").EntireRow.Hidden = True
End Sub
___________________________________________________________________
Is there a way to step the budgtcomm section so that the budgtcomm shows between the show/hide?
I'd like to combine these into one macro so that when I hit the button with all rows showing, the budgtcomm macro becomes the view, then click again and it hides the entire section, and then click again and it unhides to the budgtcomm view, and then click again and it unhides the whole section. I appreciate any help!
This is the one that shows and hides the whole section with one button:
_______________________________________________________________
Sub show_hide()
Rows("139:146").Select
If Selection.EntireRow.Hidden = True Then
Selection.EntireRow.Hidden = False
Else
Selection.EntireRow.Hidden = True
End If
End Sub
__________________________________________________________________
This one only shows only rows 139, 143, and 145 - 146
__________________________________________________________________
Sub BudgtComm()
Range("140:142,144:144").EntireRow.Hidden = True
End Sub
___________________________________________________________________
Is there a way to step the budgtcomm section so that the budgtcomm shows between the show/hide?