Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
My qvw application contains 1 list box (i.e date field) and 1 straight table.
my req is i want to export that straight table to excel and send that excel as a mail attachment,
it was done through macro,it's working fine.nw i want filter out the data based on the date field,
after that i want to export to excel.
for ex:
datefiled
5/10/2015
5/11/2015
5/12/2015
now i want to filter the data based on maxdate i.e 5/12/2015,after that i want to export to excel
how to select the max date dynamically through macro.
before exporting the data into excel,i want to select the max date dynamically.
how to achive this.
regards,
koti.
It would be better to create a variable that holds the max(Date) value and read that variable into your macro. The variable would be defined something like
=Max(Date)
(note the = is part of the variable)
See also Macros are Bad for more
Something like:
vMaxDate = Date(Max(DateField)) // front end variable definition
Sub SelFun
MaxDate = ActiveDocument.Variables("vMaxDate").GetContent.String
ActiveDocument.Fields("DateField").Select MaxDate
End Sub
PFA
Vikas