You can try and customize the below VBA Code as per requirement and see it it works in your case.
Sub sbHidingUnHideRows()
'To Hide Rows 22 to 25
Rows("5:8").EntireRow.Hidden = True
'To UnHide Rows 22 to 25
Rows("5:8").EntireRow.Hidden = False
End Sub