hide range of rows based on another cell condition

  • Thread starter Thread starter DarrenL
  • Start date Start date
D

DarrenL

I want to hide rows 5-30 if cell (I8) is empty.
any thoughts?
Thank you.
 
sub hideem()
if len(application.trim(range("i8")))<1 then
rows ("5:30").hidden=true
end if
end sub
 
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---
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top