Thread: dates in macros
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
r r is offline
external usenet poster
 
Posts: 125
Default dates in macros

Hi,

Try this kind of construction

Sub AutofilterDate()
Dim MyDate, FindDate As Date
MyDate = "13/12/2007"
FindDate = Year(MyDate) & "/" & Month(MyDate) & "/" & Day(MyDate)
Selection.AutoFilter field:=1, Criteria1:=FindDate
End Sub

Reijo