Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I have multiple sheets. I have created a trigger that selects the latest year whenever a user clicks on a sheet.
However if this user selects multiple year, and goes back to that sheet, he still sees the latest year.
My question: how configure that a sheet is by default the latest year and if a user selects other years, QV holds these values.
Thanks!
Sam
trigger should be (y is the year field)
=If(GetSelectedCount(y) = 0, Max({1}y), '(' & Concat(DISTINCT y, '|') & ')')
May be use a if statement in your trigger:
If(GetSelectedCount(Year) < 2, Max({1}Year))
to handle this you need to follow a two step process.
while setting the trigger you need to count the year selection made and set the variable using
on changes event and then in
on select you need to set the field value as well as the variable (setting the variable again is also important here ). Finally using the variable count you can set the field trigger
May be set the trigger value like this:
if(getselectedcount(Year)=0,Max(Year))
trigger should be (y is the year field)
=If(GetSelectedCount(y) = 0, Max({1}y), '(' & Concat(DISTINCT y, '|') & ')')
It's not working.
This is what I have now on one sheet:
field Year
search =max(Year)
but If I go to the next sheet and select more than 1 year and go back to my first sheet, the max year is selected.
Try Massimo Grossi solution and see if that works. If not, would you be able to share a sample?
try to use tis macro on ur document with triggers and see.
sub On_Load
ActiveDocument.ClearAll
ActiveDocument.Fields("Year").Select Year(Now())
end sub
trigger in sheet6