Custom Filter w/ formula

L

LH

How can I use a formula in a custom filter? I have a macro that formats and
sorts a report that I receive each day, but I want it to sort out everything
greater than today. I have tried to use the function =NOW(), but with no
success.
 
S

Sheeloo

Adapt the idea in the following macro to your macro;

Sub Macro1()
Dim dt As String
'Build the criteria
dt = ">" & CStr(Date)
Columns("A:C").Select
Selection.AutoFilter
'Filter the range A1:C29 on Col C using the criteria built above

ActiveSheet.Range("$A$1:$C$29").AutoFilter Field:=3, _
Criteria1:= dt
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top