Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am using the follwoing code to filter data greater than certain date. But
unfortunately all data gets hide when I run the macro. However when I open and close the autofilet after Macro has run, proper values are visible. please help me out... Date = Cells(erow - 49, 4) Sheets("data").Select Range("a6").Select Selection.AutoFilter Range("O6").Select Selection.AutoFilter Field:=15, Criteria1:="=" & Date |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try
Selection.AutoFilter Field:=15, Criteria1:="=" & Date, Criteria2:= "<=" & Date -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Nirmal" wrote in message ... I am using the follwoing code to filter data greater than certain date. But unfortunately all data gets hide when I run the macro. However when I open and close the autofilet after Macro has run, proper values are visible. please help me out... Date = Cells(erow - 49, 4) Sheets("data").Select Range("a6").Select Selection.AutoFilter Range("O6").Select Selection.AutoFilter Field:=15, Criteria1:="=" & Date |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sometimes converting the date to a long will help:
Selection.AutoFilter Field:=15, Criteria1:="=" & clng(Date) Sometimes formatting the date to match the existing format of what's in the other cells in the field will help: Selection.AutoFilter Field:=15, Criteria1:="=" & format(Date,"mm/dd/yyyy") (change that format to match your data, though) Nirmal wrote: I am using the follwoing code to filter data greater than certain date. But unfortunately all data gets hide when I run the macro. However when I open and close the autofilet after Macro has run, proper values are visible. please help me out... Date = Cells(erow - 49, 4) Sheets("data").Select Range("a6").Select Selection.AutoFilter Range("O6").Select Selection.AutoFilter Field:=15, Criteria1:="=" & Date -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() "Dave Peterson" wrote in message ... Sometimes formatting the date to match the existing format of what's in the other cells in the field will help: Selection.AutoFilter Field:=15, Criteria1:="=" & format(Date,"mm/dd/yyyy") Get the cell format in this imstance With Selection .AutoFilter Field:=15, Criteria1:="=" & Format(Date, .Cells(2, 15).NumberFormat) End With |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro with custom autofilter for greater and less than specific da | Excel Discussion (Misc queries) | |||
error when running cut & paste macro | Excel Worksheet Functions | |||
Advanced Filter not working | Excel Worksheet Functions | |||
Keyboard shortcut not working when I copy macro to another computer | New Users to Excel | |||
Macro Help In Excel | Excel Discussion (Misc queries) |