Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I have a QW application with listbox for "year" and "month" and I wonder if its possible to create a trigger
so that actual year and actual month is displaying every time a user accessing the sheet. Some sheet should have
no filter and I have been implementing that as a trigger. Not sure how to use values as triggers
/mikael
Hi,
For this you have to make sheet trigger. Go to Sheet property ->trigger->OnActivateSheet->Add->Selection->Select In Field->OK
Now in the Field put your YEAR _field . In the "Search String" write: =Year(Today())
The same you can do for MONTH also.
Thanks and Regards,
tresesco
Hi,
And if i have a MonthYear Field, how can do it for this?
Regards
Orlando
in the script you can create a MonthYear field and then you can trigger sheet with this new field as suggested by Tresesco.
Regards,
Sharma
In your script with your full date...
MONTHNAME(YOUR_FULL_DATE) AS month_year,
Thanls for your answer but, i've already do that, my question is how can i put in the trigger to get always the actual date?
Select the desired field in the trigger on Sheet (the one you want to have the Actual/Current date) and in the Search condition put Year(Today()) or Month(Today()) depending upon what you want as Selection.
Regards,
Sharma
SHARMA:
IF I NEED BOTH OF THEM I CAN PUT LIKE THIS YEAR(TODAY()) & MONTH(TODAY())?
Thank you for your answer / regards mikael
'Otherwise you can achieve this by using Macros.YOU CAB HAVE TWO VARIABLES CREATED LIKE :
Month_now=Month(now())
and Year_now=Year(now())
and then macro like this:
sub active:
activedocument.variables("Month_now")
activedocument.variables("Year_now")
end sub
(please check for actual syntax for macro)
after that trigger this macro for all the sheets where you want to have current month and years selected.
P.S this is just a hint and might help you out.
Cheers,
Sharma