Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
Hi!
In my macro I want to automaticaly select a possible value depending on antoher value (obviously) that i've selected manually.
Is this possbile?
Thanks!
//A.
 
					
				
		
 gandalfgray
		
			gandalfgray
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Annika
You can select all possible values in a field like this:
ActiveDocument.Fields("Month").SelectPossible
If you want to select matching a specific search value:
ActiveDocument.Fields("Month").Select "September"
(selects September)
ActiveDocument.Fields("Month").Select "J*"
(selects January, June, July)
ActiveDocument.Fields("Sales").Select ">1500"
(selects all Sales larger than 1500)
hope this helps!
 
					
				
		
 montubhardwaj
		
			montubhardwaj
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Why going for MAcros? you can easily achieve it through Triggers/Actions
 
					
				
		
 gandalfgray
		
			gandalfgray
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Annika
You can select all possible values in a field like this:
ActiveDocument.Fields("Month").SelectPossible
If you want to select matching a specific search value:
ActiveDocument.Fields("Month").Select "September"
(selects September)
ActiveDocument.Fields("Month").Select "J*"
(selects January, June, July)
ActiveDocument.Fields("Sales").Select ">1500"
(selects all Sales larger than 1500)
hope this helps!
 
					
				
		
You're both right!
Thank you for your help!
😃
 
					
				
		
 IAMDV
		
			IAMDV
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Have you considered using Indirect Set Analysis, which is more faster than macros & triggers.
• p( ) = Possible
• e( ) = Excluded
Example
sum(({<Year={$(=max(Year))},
Customer = p({<Year={$(=max(Year)-1)} Customer>}) Sales)
Cheers - DV
 
					
				
		
Hi GandalfGray,
I have a similar kind of a requirement.Tried to iimplement whatever you have told but to no effect
Could you please elobarate on the Macro whatever you have mentioned.Should I take the
possible values into a variable.
Regards
Navin Gorapalli
 
					
				
		
 gandalfgray
		
			gandalfgray
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		This is how a subroutine to select the possible values in the field "Month" could be written:
sub SelectPossibleInMonth()
ActiveDocument.Fields("Month").SelectPossible
end sub
then you obviously must call the macro whenever you want 
You don't need any variables.
ActiveDocument.Fields("Month") specifies that its your field "Month" that the SelectPossible should be applied for.
 
					
				
		
Can you shed a little insight on how to accomplish this via and Action? Thanks!
 
					
				
		
 gandalfgray
		
			gandalfgray
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Of course!
See the attached application, where possible colors are selected based on which fruit(s) are selected when the button is activated!
 
					
				
		
Ahh, I'm sorry - I thought there was a way to do it without a macro. This will work for m, but I thought Macros were deprecated?
