Hello!
I have a small problem with a simple macro that I have assigned to a button. The thing is: I just want it to hide empty rows. This works perfectly, but running the program on 200 rows takes about 15 seconds to run, which seems incredibly long to me.
I was wondering if I made a mistake in the macro, or is there a way to make it much... lighter?
Thank you in advance,
Carel
Private Sub CommandButton21_Click()
BeginRow = 2
EndRow = 201
ChkCol = 2
For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value < 1 Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
Else
Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
End Sub
Bookmarks