From numerous sources, I have been able to get this code to work:
Sub Unhide_and_Hide_Rows_based_upon_ColumnZ()
Rows("1:300").Select
Selection.EntireRow.Hidden = False
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual 'pre XL97 xlManual
Dim Rng As Range, ix As Long
Set Rng = Intersect(Range("Z9:Z300"), ActiveSheet.UsedRange)
For ix = Rng.Count To 1 Step -1
If Trim(Replace(Rng.Item(ix).Text, Chr(160), Chr(32))) = "" Then
Rng.Item(ix).EntireRow.Hidden = True
End If
Next
done:
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
This code will look for "empty cells" within the Z9:Z300 range. If they are empty (incuding formulas that result in 0 or no value) the row is hidden. My next task is to redefine the range to Z9:Z43, Z50:75 and Z90:Z300. Can anyone help me change the code above so this range is affected? Thanks.
jh
Bookmarks