Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Filter on today...how possible?

Hi all,

In the below VBA code I want to filter on Today. To do so I place
today's date in a cell and copied that with the filtering.
Unfortunately in the code 30/03/07 is places. Can somebody tell me how
I could fix this?
Thanks in advance,

Wietse

VBA code:
Range("F26").Select
ActiveCell.FormulaR1C1 = "=TODAY()"
Range("B28:F28").Select
Range(Selection, Selection.End(xlDown)).Select
Range("B28:F300").Select
Selection.AutoFilter
ActiveWindow.SmallScroll Down:=-12
Range("F26").Select
Selection.Copy
Selection.AutoFilter Field:=5, Criteria1:="<30/03/07",
Operator:=xlAnd

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Filter on today...how possible?

Try this:

Criteria1:=DateValue(Now)

Hth,
Merjet


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Filter on today...how possible?

Problem is that there is a smaller then sign before and using the code
you mentioned with a smaller sign before doens't work....any
suggestions?

On Mar 30, 4:12 pm, "merjet" wrote:
Try this:

Criteria1:=DateValue(Now)

Hth,
Merjet



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Filter on today...how possible?

Thanks but it doesn't seems to work. When useing the code you
mentioned the filter uses a other value and nothing is filtered out.
Other ideas?

On Mar 30, 4:36 pm, Dave Peterson wrote:
maybe...
Selection.AutoFilter Field:=5, Criteria1:="<" & format(date, "dd/mm/yy"), ...





wrote:

Hi all,


In the below VBA code I want to filter on Today. To do so I place
today's date in a cell and copied that with the filtering.
Unfortunately in the code 30/03/07 is places. Can somebody tell me how
I could fix this?
Thanks in advance,


Wietse


VBA code:
Range("F26").Select
ActiveCell.FormulaR1C1 = "=TODAY()"
Range("B28:F28").Select
Range(Selection, Selection.End(xlDown)).Select
Range("B28:F300").Select
Selection.AutoFilter
ActiveWindow.SmallScroll Down:=-12
Range("F26").Select
Selection.Copy
Selection.AutoFilter Field:=5, Criteria1:="<30/03/07",
Operator:=xlAnd


--

Dave Peterson- Hide quoted text -

- Show quoted text -





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Filter on today...how possible?

Criteria1:="<" & DateValue(Now)

Hth,
Merjet


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
How to filter for Dates prior to Today Tommy Excel Discussion (Misc queries) 1 June 4th 10 03:51 PM
filter using today() carly Excel Discussion (Misc queries) 2 August 9th 07 06:29 PM
IF TODAY equals date in cell A10, or if TODAY is beyond that date SoupNazi Excel Worksheet Functions 4 April 23rd 07 01:14 AM
"Criteria Range" in the "Data/Filter/Advanced Filter" to select Du TC Excel Worksheet Functions 1 May 12th 05 02:06 AM
=IF(OR(TODAY()G9),"Pass","Overdue") Why doe it not wo. Fkor Excel Discussion (Misc queries) 3 March 10th 05 08:29 AM


All times are GMT +1. The time now is 07:55 PM.

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"