Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have 5 sheets. Every time the user goes to sheet 1, I want to clear all the selection on this sheet only
and leaving the other sheets unaffected. Is this possible? When I setup a trigger on sheet 1 and chose "Clear All", it
cleared the selections on all the sheets which isn't what I want to do.
Thanks
Anil,
I tested out your snippet. It turns out your code will clear all sections not just one object, ex: CH01.
I looked further into the QV API and found the solution and this works for me. All I need is to execute one
of these lines. First one clears everything but "year". Second clears "year" only.
ActiveDocument.Fields("year").ClearAllButThis
ActiveDocument.Fields("year").Clear
Thought I post this back.
Thanks
I am not sure, There is direct way. But you can try Sheet activated with Clear All action
OR
By using macro, you may can try this
Sub RemoveOnlyOneSelected
Set QvObj=Activedocument.GetSheetObject("CH01")
Set A=QvObj.GetField
Set FieldProp=A.GetProperties
FieldProp.OneAndOnlyOne=False
A.SetProperties FieldProp
ActiveDocument.ClearAll True
End Sub
Anil,
If I'm reading your code correctly, that looks like it's for a specific object. How do you operate on sheet level? I don't see sheet being an object when I looked at document properties.
Anil,
I tested out your snippet. It turns out your code will clear all sections not just one object, ex: CH01.
I looked further into the QV API and found the solution and this works for me. All I need is to execute one
of these lines. First one clears everything but "year". Second clears "year" only.
ActiveDocument.Fields("year").ClearAllButThis
ActiveDocument.Fields("year").Clear
Thought I post this back.
Thanks