This is a very basic question, however, I have not been able to find a solution online thus far. I have a macro that processes a large amount of data and usually takes about 2-3 seconds to run. However, I hide some of the cell it references to protect those cells from being edited by other users and now the macro takes 5-10 minutes to run. Any idea as to why this occurs and how to circumvent it? Thanks in advance!
'Delete previous data from the same month
Sheet3.Select
intValueToFind = Sheet8.Range("K6")
Range("A2").Select
Selection.AutoFilter
ActiveSheet.UsedRange.Select
Selection.AutoFilter field:=9, Criteria1:=intValueToFind
Selection.Offset(1, 0).Select
lr = Cells(Rows.Count, 1).End(xlUp).Row
If lr > 1 Then
Range("a2:A" & lr).SpecialCells(xlCellTypeVisible).EntireRow.Delete
End If
The issue begins around the Selection.Autofilter line.