I am trying to hide all rows which have blank cells in a certain column (Column H in the SOW tab).
This same macro (different rows but same syntax) worked on the third tab in this workbook. I checked, each row in the range is correct. Could it be that the range is too long?
Sub HideRowsInSOW_LOOP() Dim r As Range, c As Range Set r = Range("H27:H46,H48:H67,H69:H88,H90:H109,H111:H130,H132:H151,H153:H172,H174:H193,H195:H214,H216:H235,H237:H256,H258:H277,H279:H298,H300:H319,H321:H340,H342:H361,H369:H388,H390:H409,H411:H430,H432:H451,H453:H472,H474:H493,H495:H514,H516:H535,H537:H556,H558:H577,H579:H598,H600:H619,H621:H640,H642:H661,H663:H682,H684:H703") Application.ScreenUpdating = False For Each c In r If c.Value = 0 Then c.EntireRow.Hidden = True Else c.EntireRow.Hidden = False End If Next c Application.ScreenUpdating = True End Sub When running this, I get the following error:
run-time error '1004' error message: Method 'Range' of object '_Global' failed
I have a much longer macro which serves the same purpose successfully and am worried about it slowing down my workbook/keep hearing that loop is better anyway.

r.SpecialCells(xlCellTypeBlanks)instead of a check using a if condition if a cell is blank.