How do I hide a row in excel if a certain other cell is populated

G

Guest

I would like to have certain cells in my excel workbook to be used as on/off
switches that will hide other rows if designated. How do I do this?
 
C

Carim

Hi Teresa,


With an event macro to be inserted in a sheet module ...

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("A1").Value = 0 Then
'adjust to your need
Range("A1").Offset(6, 0).EntireRow.Hidden = True 'adjust to
your need
Else
Range("A1").Offset(6, 0).EntireRow.Hidden = False
End If
End Sub

HTH
Cheers
Carim
 

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

Top