horizonflame
Board Regular
- Joined
- Sep 27, 2018
- Messages
- 186
- Office Version
- 2013
Hi All
I am applying a filter to a column where sometimes no data will be found (as expected). Can someone help with code to step past the 'Runtime 1004' error so the macro carries on?
Thanks
I am applying a filter to a column where sometimes no data will be found (as expected). Can someone help with code to step past the 'Runtime 1004' error so the macro carries on?
Thanks
Code:
Selection.AutoFilter
ActiveSheet.Range("$A$1:$Q$2000").AutoFilter Field:=13, Criteria1:=RGB(204 _
, 153, 255), Operator:=xlFilterCellColor
Application.Goto Reference:="R3C1:R2000C1"
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Sheets("Sheet2").Select
Range("I4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False