ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hide a row based on values (https://www.excelbanter.com/excel-programming/304397-hide-row-based-values.html)

stevenmckeon

Hide a row based on values
 
Is it possible to hide a row based on a value within the row?

If cell A1= true display row A

else hide row A from view

I will be running this in all versions of Excel from 97 to 2003 ar
there any limitations on which will work and which will not?

Any assistance is appreciated

--
Message posted from http://www.ExcelForum.com


Bob Phillips[_6_]

Hide a row based on values
 
Steve,

Are you looking for a macro to loop through a range hiding as it goes, or
one that hides the row as A1 doesn't equal TRUE? If the latter, how would
you reset?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"stevenmckeon " wrote in
message ...
Is it possible to hide a row based on a value within the row?

If cell A1= true display row A

else hide row A from view

I will be running this in all versions of Excel from 97 to 2003 are
there any limitations on which will work and which will not?

Any assistance is appreciated.


---
Message posted from http://www.ExcelForum.com/




ross

Hide a row based on values
 
Hi try this

Private Sub CommandButton1_Click()

If Range("A12").Value = "True" Then
Rows("9:9").Select
Selection.EntireRow.Hidden = True
Else
Rows("9:9").Select
Selection.EntireRow.Hidden = False
End If
End Sub

good luck

ross

stevenmckeon[_2_]

Hide a row based on values
 
Thanks Ross - this will do nicely!

Appreciate the assistance.

ross wrote:
*Hi try this

Private Sub CommandButton1_Click()

If Range("A12").Value = "True" Then
Rows("9:9").Select
Selection.EntireRow.Hidden = True
Else
Rows("9:9").Select
Selection.EntireRow.Hidden = False
End If
End Sub

good luck

ross


--
Message posted from http://www.ExcelForum.com



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

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