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

Variable in a dimension not working :-(

Hi All,

I have a dimension.. where vThisWeek is a variable

if (SalesWeek= vThisWeek,'Yes')

which works fine, but then I want to change it using a macro and hence want to use another variable i.e.

vReportNeeded =    vThisWeek OR SalesWeek = vLastWeek

and then have if( SalesWeek=vReportNeeded, 'Yes') but it doesn't seem to work and produces no figures.

I ant to throw various week values at it, hence the variable

Anyone any ideas please ?

Thanks in advance

Bob

1 Solution

Accepted Solutions
SunilChauhan
Champion
Champion

use with $ sign

and in dimension  use like '$(Variable name)'

Sunil Chauhan

View solution in original post

4 Replies
fkeuroglian
Partner - Master
Partner - Master

Hi, using macro you have to get and set value from variables, not using =

i put an example

good luck

get value from variable:

set vFromDateTransito = ActiveDocument.Variables("vFromDateTransito")

set value:

set ValorVariable = ActiveDocument.Variables("vTest2")      

          v = "1"   

          ValorVariable.SetContent v , true

Not applicable
Author

Hi thanks for the reply but it does nto help I am afraid.

I have a macro that sets the variable, but after it has set the variable the dimnesion will still not produce figures from it

SunilChauhan
Champion
Champion

use with $ sign

and in dimension  use like '$(Variable name)'

Sunil Chauhan
Not applicable
Author

How frustratiingly simple - thank you !! 🙂