I want to hide a row when the value in column A=0. If there needs to be a limit then it would be A1:A1000 with any number of rows that can be hidden.
I would also like the code to run only when the sheet is opened.
I've also got a similar use for this, except instead of a cell value =0, I needed it to check for a string value of "Done" .
Fluff - I tried your version and changed 0 to "Done", but it hid my entire sheet.
James006 - I tried yours as well and replaced "0" with "Done" but this also did nothing. Why does your code use .Range and Fluff's does not?
RussK68 - I came across this on the interwebs and it worked for me on a test sheet..
Private Sub Worksheet_Calculate()
Dim LastRow As Long, c As Range
Application.EnableEvents = False
LastRow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
On Error Resume Next
For Each c In Range("A1:A" & LastRow)
If c.Value = "0" Then
c.EntireRow.Hidden = True
On Error GoTo 0
Application.EnableEvents = True