ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   hide range of rows based on another cell condition (https://www.excelbanter.com/excel-programming/430062-hide-range-rows-based-another-cell-condition.html)

DarrenL

hide range of rows based on another cell condition
 
I want to hide rows 5-30 if cell (I8) is empty.
any thoughts?
Thank you.


Don Guillett

hide range of rows based on another cell condition
 
sub hideem()
if len(application.trim(range("i8")))<1 then
rows ("5:30").hidden=true
end if
end sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"DarrenL" wrote in message
...
I want to hide rows 5-30 if cell (I8) is empty.
any thoughts?
Thank you.



ryguy7272

hide range of rows based on another cell condition
 
Try this:
Sub Hide()
If Range("I8") = "" Then
Rows("5:30").RowHeight = 0
End If
End Sub


Sub Unhide()

Cells.Select
Selection.RowHeight = 12.75
End Sub

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"DarrenL" wrote:

I want to hide rows 5-30 if cell (I8) is empty.
any thoughts?
Thank you.



All times are GMT +1. The time now is 12:38 PM.

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