Custom Filter w/ formula
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. |
Custom Filter w/ formula
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 "LH" wrote: 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. |
All times are GMT +1. The time now is 08:17 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com