STEVENS3010
Board Regular
- Joined
- Feb 4, 2020
- Messages
- 87
- Office Version
- 365
- 2016
- Platform
- Windows
Hi all,
I have a sheet with 5 columns of data that I need filter one column for a a specific value. I've used the macro recorded to help me; the script is below...
My questions are, based on the above script, am I correct in assuming it will only filter the range between A2:E5654? If so, as the number of rows of data will be changing, is it possible to code the script to run between columns A and E, but to automatically look for the last row, rather than specifying a particular row number?
My second question then was around copying and pasting the filtered data to a new sheet. Is it possible? If so, is it clever enough to only copy and paste the filtered data, even if this changes every time the filter is applied?
If anybody could help I'd really appreciate it.
Thanks.
I have a sheet with 5 columns of data that I need filter one column for a a specific value. I've used the macro recorded to help me; the script is below...
VBA Code:
Selection.AutoFilter
ActiveSheet.Range("$A$2:$E$5654").AutoFilter Field:=3, Criteria1:=Array( _
"AWAIT DIP UNDERWRITING"), _
Operator:=xlFilterValues
My questions are, based on the above script, am I correct in assuming it will only filter the range between A2:E5654? If so, as the number of rows of data will be changing, is it possible to code the script to run between columns A and E, but to automatically look for the last row, rather than specifying a particular row number?
My second question then was around copying and pasting the filtered data to a new sheet. Is it possible? If so, is it clever enough to only copy and paste the filtered data, even if this changes every time the filter is applied?
If anybody could help I'd really appreciate it.
Thanks.