Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Autofilter to tak on an Inputted Value
I have a Macro that cleans down a report then moves on to filter out a list
of data for a date period using Autofiltering, I have included the following to be prompted for the date to be filtered, however it never filters on the date I input, I need to use an put method as the report is required for different dates and then moves on to do other things Range("G1").Select MyValue = Application.InputBox("Enter a Date") Selection.AutoFilter Field:=7, Criteria1:=MyValue Can anyone advise on how I can get the autofilter method to take on the value from the input request TIA mmc308 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Autofilter to tak on an Inputted Value
On May 19, 9:22 am, mmc308 wrote:
I have a Macro that cleans down a report then moves on to filter out a list of data for a date period using Autofiltering, I have included the following to be prompted for the date to be filtered, however it never filters on the date I input, I need to use an put method as the report is required for different dates and then moves on to do other things Range("G1").Select MyValue = Application.InputBox("Enter a Date") Selection.AutoFilter Field:=7, Criteria1:=MyValue Can anyone advise on how I can get the autofilter method to take on the value from the input request TIA mmc308 Maybe either "Criteria1:=CDate(MyValue)" or "CDate(Applicaiton.InputBox("Enter a Date")"? For something more sophisticated (and to prevent garbage input!) you could look at http://www.fontstuff.com/vba/vbatut07.htm -Bryan |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Autofilter to tak on an Inputted Value
Bryan
Thanks for your time sorted this by carrying out the following on the column Range("G:G").Select Selection.NumberFormat = "dd/mm/yyyy;@" Many Thanks mmc308 "Bryan Loeper" wrote: On May 19, 9:22 am, mmc308 wrote: I have a Macro that cleans down a report then moves on to filter out a list of data for a date period using Autofiltering, I have included the following to be prompted for the date to be filtered, however it never filters on the date I input, I need to use an put method as the report is required for different dates and then moves on to do other things Range("G1").Select MyValue = Application.InputBox("Enter a Date") Selection.AutoFilter Field:=7, Criteria1:=MyValue Can anyone advise on how I can get the autofilter method to take on the value from the input request TIA mmc308 Maybe either "Criteria1:=CDate(MyValue)" or "CDate(Applicaiton.InputBox("Enter a Date")"? For something more sophisticated (and to prevent garbage input!) you could look at http://www.fontstuff.com/vba/vbatut07.htm -Bryan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Data Changes itself after I have inputted. | Excel Discussion (Misc queries) | |||
Getting Last Value that inputted | Excel Discussion (Misc queries) | |||
Read Last Inputted Value? | Excel Programming | |||
Calculating from last inputted cell | New Users to Excel | |||
Due date changes when new value is inputted in a different column | Excel Programming |