I have a spreadsheet that will search through rows to see if there is a match to "C8" (a facility name based on the drop down selection). If so, it should display matching rows only and hide all others. The macro works very slowly. There are 1280 rows. Please advise on how I can shorten this run time.
The workbook can be seen here: WorkBook_Link
The macro is called "HideRowsOtherThanSelected" and initiated by clicking on the facility icon on C8.
Thanks in advance from a newbie.
The workbook can be seen here: WorkBook_Link
The macro is called "HideRowsOtherThanSelected" and initiated by clicking on the facility icon on C8.
VBA Code:
Sub HideRowsOtherThanSelected()
StartRow = 12
EndRow = 1282
ColNum = 12
For i = StartRow To EndRow
If Cells(i, ColNum).Value <> Range("C8").Text Then
Cells(i, ColNum).EntireRow.Hidden = True
Else
Cells(i, ColNum).EntireRow.Hidden = False
End If
Next i
End Sub
Thanks in advance from a newbie.