vbanewbie68
Board Regular
- Joined
- Oct 16, 2021
- Messages
- 171
- Office Version
- 365
- Platform
- Windows
- MacOS
Hi
Everything is working fine, only one thing, when the macro moves the selected data onto a new workbook as per the attached screenshot capture1. This is good so far but the issue is that the autofilter is still visible. When I remove the autofilter it expands the whole data for the 214 records instead of 4 records. My code is as below using Greater Than in VBA. I have tried to use paste special and this doesn’t work. What is the best way to do this?
' Input Greater than
ActiveSheet.Range("A1").AutoFilter Field:=7, Criteria1:=">" & Application.InputBox("Great Than Date"), Operator:=xlAnd
'Move to new workbook
ActiveSheet.Move
Ideally it would be as the attached screenshot capture 2. I run a macro, I get an inputbox to allow me to enter the date using the Greater than. This will select the data and move it to a new workbook. Hope this makes sense?
Your help is much appreciated on this matter.
Thank you
Regards
Everything is working fine, only one thing, when the macro moves the selected data onto a new workbook as per the attached screenshot capture1. This is good so far but the issue is that the autofilter is still visible. When I remove the autofilter it expands the whole data for the 214 records instead of 4 records. My code is as below using Greater Than in VBA. I have tried to use paste special and this doesn’t work. What is the best way to do this?
' Input Greater than
ActiveSheet.Range("A1").AutoFilter Field:=7, Criteria1:=">" & Application.InputBox("Great Than Date"), Operator:=xlAnd
'Move to new workbook
ActiveSheet.Move
Ideally it would be as the attached screenshot capture 2. I run a macro, I get an inputbox to allow me to enter the date using the Greater than. This will select the data and move it to a new workbook. Hope this makes sense?
Your help is much appreciated on this matter.
Thank you
Regards