This content has been marked as final. Show 2 replies
I am using a macro to select a date range. i have created a button to run the macro but whenever i press the button, it opens up the macro editor window...
the macro is :
sub DataBetweenSelectedDate 'Used with the Variables , it filter the reports for two selected dates
set FD = ActiveDocument.Variables("From date") '' variable for Initial date
FrmDate=">=" & month(FrmDtt) & "/" & Day(FrmDtt) & "/" & year(FrmDtt)
set TD = ActiveDocument.Variables("To date")
ToDate="<=" & month(ToDtt) & "/" & Day(ToDtt) & "/" & year(ToDtt)
if FrmDtt>ToDtt then
msgbox "Start Date Should be less than End Date"
ActiveDocument.Fields("T_DAY_DATE").Select FrmDate & ToDate
Please help to resolve this issue..