Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Getting a Sheet to Load With "At Least One Selected"

Hi,

I have a document with multiple sheets. Every sheet has the same list box, titled "SubRegion". When one particular sheet (Sheet "A") is clicked on, I need for 'always one selected value' to be selected in the SubRegion list box (or a macro with similar function). When I leave Sheet A and go to Sheet B, I need to be able to clear the SubRegion value, but not until I exit Sheet A.

Any clue on how to do this? Thanks in advance.

-Michael

5 Replies
Not applicable
Author

No luck?

Not applicable
Author

Hi,

Maybe an example qvw file will better illustrate what you are looking for. Will help in trying to solve your problem

Nimish

Not applicable
Author

Sub SubRegionSelectClear

set ss = ActiveDocument.ActiveSheet

IF ss.GetProperties.Name ="SheetB" THEN

ActiveDocument.Fields("SubRegion").Clear

END IF

END SUB

Not applicable
Author

Hi

This is possible to do via macros but an alternative solution would be to specify a calculation condition on the charts on Sheet A, like this:
if(count(distinct SubRegion)=1, 1, 0)

You can then specify a error message like "You must select one, and only one, value in SubRegion...." by going to Chart properties, click the Error Messages-button and write your text for "Calculation condition unfulfilled".

/Fredrik

Not applicable
Author

Thank you everyone for your feedback. I aim to experiment with both methods today

Michael