I recently started learning excel vba and so far I have relied heavily on the 'record macro' option for a lot of the formatting work. I've run into an issue, where I need the code to delete filtered rows (while keeping the headers), but the number of rows changes between sheets so I can't code for a specific range.
I need the code to autofilter for the designated criteria, then delete all those rows. I know the code needs to find the last row as part of the process but I'm not sure how to go about changing the recorded code. The screenshot shows the recorded code. The AJ part of the "ActiveSheet.Range("$A$1:$AJ$114127")" can change to anything depending on the sheet.
Any suggestions on how to fix this?
I need the code to autofilter for the designated criteria, then delete all those rows. I know the code needs to find the last row as part of the process but I'm not sure how to go about changing the recorded code. The screenshot shows the recorded code. The AJ part of the "ActiveSheet.Range("$A$1:$AJ$114127")" can change to anything depending on the sheet.
Any suggestions on how to fix this?