Check status row (hidden or visible)?

  • Thread starter Thread starter Martin Los
  • Start date Start date
M

Martin Los

How can I put both macros in 1?

I need a VBA line that checks whether lines are hidden or
not, something like:

Sub HOW_TO_DO?
If Rows(Range("I109:I115").Select) = Hidden Then
Show_Rows
Else
Hide_Rows
End If
ENd Sub

Private Sub Hide_Rows()
Range("I109:I115").Select
Selection.EntireRow.Hidden = True
Range("I116").Select
End Sub

Private Sub Show_Rows()
Range("I105:U116").Select
Selection.CopyPicture Appearance:=xlScreen,
Format:=xlPicture
End Sub

TIA

Martin
 
Use this code : Rows("1:5").EntireRow.Hidden = Not
Rows("1:5").EntireRow.Hidden

Adjust row numbers in above line of code to suit your needs.

Amit
 
Back
Top