Hello,
I've been trying to make a fast way to hide Rows in a sheet. solutions I found were slowing down the app tremendous when applying a EntireRow.Hidden after each check as seen below.
but in a sheet for over 500 records. I can make Cofee twice after I applied my filter.
and each time I get an error when I use Range(myRows).Select
note that I don't want to use the Sort method for this one as I'm already Sorting the records based on Dates in other parts of the sheet.
I've been trying to make a fast way to hide Rows in a sheet. solutions I found were slowing down the app tremendous when applying a EntireRow.Hidden after each check as seen below.
Code:
While Len(Range("A" & CStr(r)).Value) <> 0
If Range("N" & CStr(r)).Value <> "d" Then
Rows(CStr(r) & ":" & CStr(r)).Select
Selection.EntireRow.Hidden = True
End If
Wend
but in a sheet for over 500 records. I can make Cofee twice after I applied my filter.
and each time I get an error when I use Range(myRows).Select
Code:
Dim myRows As String
While Len(Range("A" & CStr(r)).Value) <> 0
If Range("N" & CStr(r)).Value <> "d" Then
myRows = myRows & r & ":" & r & ","
End If
r = r + 1
'remove last comma from the string when we're at the end of the sheet.
If Len(Range("A" & CStr(r)).Value) = 0 Then
myRows = Left(myRows, Len(myRows) - 1)
End If
Wend
# Range(myRows).Select ##### Error
Selection.EntireRow.Hidden = True
note that I don't want to use the Sort method for this one as I'm already Sorting the records based on Dates in other parts of the sheet.
Last edited: