Rob In Deo speramus. Premium join:2001-08-25 Kendall, FL kudos:3
[Excel] Macro to Hide Rows
I have this macro that will hide a row where the value in the P column is zero:
Sub HideRows() Application.ScreenUpdating = False Sheets("OVERVIEW_ACTIVITY").Select 'Change as required Range("P4:P390").Select 'Change as required For Each cell In Selection If cell = 0# Then Range(cell.Address).EntireRow.Hidden = True End If Next End Sub
I'm trying to modify it so that the value in the cell must be 0 and not blank. I have blank rows that are headers within the table, so it sees those as zeros and hides them. More rows will be added overtime, so I'd like the macro to just look at the value of the cell and if NOT blank, but it is equal to zero, to hide it.