ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Check status row (hidden or visible)? (https://www.excelbanter.com/excel-programming/285764-check-status-row-hidden-visible.html)

Martin Los

Check status row (hidden or visible)?
 
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

Amit Shanker

Check status row (hidden or visible)?
 
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


"Martin Los" wrote in message
...
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





All times are GMT +1. The time now is 11:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com