View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
StargateFan[_3_] StargateFan[_3_] is offline
external usenet poster
 
Posts: 171
Default Way to have VB code to filter on entries that have cell with today's date?

On Mon, 16 May 2005 07:52:21 -0400, StargateFan
wrote:

On Sat, 14 May 2005 02:34:35 -0400, StargateFan
wrote:

On Fri, 6 May 2005 07:56:56 -0400, "Tom Ogilvy"
wrote:

don't put it in double quotes

Selection.AutoFilter Field:=11, Criteria1:=Date


Tom, hi. This didn't work and I'm wondering why. The macro looks
like this now:

Sub TestDueTODAY()
' Macro recorded 5/14/2005 by .
'
Selection.AutoFilter Field:=10, Criteria1:="<"
Selection.AutoFilter Field:=10, Criteria1:=Date
End Sub

Does the difficulty lie with the formatting of the date? Although I
enter with ^+; to get today's date, the cell format is in
ddd.mmm.dd.yyyy so it's easier for the user to read. Does the problem
lie there?

I get values, of course, with the < filter entry. I've tried the
above macro with just each line and the < works fine. The Date one
doesn't. (p.s., the column here is a different one that the trial I
was using before. I have the actual file with me now and that's why
it's a 10 here instead of an 11 like before, but that part's okay).

Tx.


[snip]

Was wondering if anyone knew why the Date feature wouldn't bring up
entries with today's date. There are entries there, I make sure to
add some in the test file. Tx.