View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
GIT-R-DONE[_2_] GIT-R-DONE[_2_] is offline
external usenet poster
 
Posts: 1
Default Problems implementing advanced filter code...


Dave, that worked great for 3 of my 4 reports that I am automating. Now
on the one that I am getting stumped on, you might be able to help me
out with as well. My field that I am filtering by is a date and time
field (ie "12/1/2005 12:52:39 AM") I am only wanting to filter by the
date part of it. I am tried using a loop that brought out the
month/day/year out of that, but the filter tries to filter by the
fomula and not the results of the formula.

My loop is this:

Code:
--------------------
Range("A2").Select
Do
ActiveCell.FormulaR1C1 = "=DATE(YEAR(RC[2]),MONTH(RC[2]),DAY(RC[2]))"
ActiveCell.Offset(1, 0).Select
Loop Until IsEmpty(ActiveCell.Offset(0, 2))

--------------------


So the contents of the cells would be
"=DATE(YEAR(C3),MONTH(C3),DAY(C3))" and when the filter macro hits
that, the contents of the L look like this
"DATE(YEAR(J3),MONTH(J3),DAY(J3))" when I need them to be 12/03/2005.


Does that make sense? Is there anything that I can do to the Filter
Macro to make it pull the date only out of the date and time field, or
should I keep my loop in there, that extracts the date. If so, can the
filter macro be changed to pull the results of the loop instead of the
formula?


--
GIT-R-DONE
------------------------------------------------------------------------
GIT-R-DONE's Profile: http://www.excelforum.com/member.php...o&userid=29960
View this thread: http://www.excelforum.com/showthread...hreadid=390833