Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Changes itself after I have inputted. Funky Excel Discussion (Misc queries) 5 September 27th 07 01:25 PM
Getting Last Value that inputted instereo911 via OfficeKB.com Excel Discussion (Misc queries) 0 April 25th 07 07:51 PM
Read Last Inputted Value? Yin99 Excel Programming 2 July 19th 06 03:56 AM
Calculating from last inputted cell Petermac New Users to Excel 3 May 31st 06 02:11 PM
Due date changes when new value is inputted in a different column John Excel Programming 3 November 11th 05 05:53 PM


All times are GMT +1. The time now is 09:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"