how to hide a number of cells based on one cell?
Very Clever!
--
Gary''s Student - gsnu200858
"Rick Rothstein" wrote:
If Range("A1").Value = "no" Then
Range("A4:A15").EntireRow.Hidden = True
Else
Range("A4:A15").EntireRow.Hidden = False
End If
I thought you might be interested in knowing that the above 5 lines can be
replaced by this single line of code...
Range("A4:A15").EntireRow.Hidden = Range("A1").Value = "no"
--
Rick (MVP - Excel)
"Luke M" wrote in message
...
You can do that with the VBE. Right click on sheet tab, go to view code.
Paste this in, then close the editor:
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("A1").Value = "no" Then
Range("A4:A15").EntireRow.Hidden = True
Else
Range("A4:A15").EntireRow.Hidden = False
End If
If Range("A19").Value = "no" Then
Range("A20:A100").EntireRow.Hidden = True
Else
Range("A20:A100").EntireRow.Hidden = False
End If
End Sub
--
Best Regards,
Luke M
*Remember to click "yes" if this post helped you!*
"TG" wrote:
Hello,
How would I be able to hide lets say row 4-15 if A1 had the word no?
Is this even possible? Also, what if i also want to hide rows 20-100 if
A19
says "no"?
Thank you in advance,
TG
|