I am attempting to create a macro that will filter a raw dataset and will copy and paste results to a new tab. However, I am only wanting to copy and paste if there is data meeting the filter criteria. Please see below for the filter and code. The underlined code is where I am receiving a Run-Time Error 6 error stating Overflow. I believe this is due to no data meeting the filter critiera. Please advise the best way to taylor the code to make this work.
ActiveSheet.Range(Cells(1, 1), Cells(LastRow, LastCol)).AutoFilter Field:=9, Criteria1:="<>"
SPTCount = ActiveSheet.Range("A1").End(xlDown).Row
If (SPTCount > 1) Then
......
Bookmarks