variable in GetRef function

Started by dmac101, April 04, 2023, 02:51:39 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dmac101

Hi All,
I am trying to set up a shape that updates a user cell in the page shapesheet based on a user selectable field
When i drop the shape onto the page i have a prompt to select an ID from a fixed list. I.e A1
I then want a formula to set a field on the page shape sheet corresponding to A1

for example SetF(GetRef(ThePage!User.ID),Prop.Attenuation)
So if Prop.ID = A1, then the above would be SetF(GetRef(ThePage!User.A1),Prop.Attenuation)

How do i set a variable into the formula so i can change the ID and evaluate it correctly?

Thanks
Darren

wapperdude

#1
It looks like you need to setup a dummy entry in the User Section of the page shape sheet to accept the formula.

Let's say for sake of argument, it is User.Row_9.  In the User.Row_9 Value cell, enter this formula:
SETF(GetRef(User.ID),"=setf(getref(Sheet.1!User.set" & Sheet.1!Prop.ID & "),Sheet.1!Prop.Val)").  This ends up pushing this formula into the User.ID cell =>  SETF(GetRef(Sheet.1!User.set5),Sheet.1!Prop.Val) 

In my test case, Sheet.1!Prop.ID had value = 5, and my Sheet.1 has a User.set5 row.  Now edit the User.Row_9 formula to reflect your exact needs.
Visio 2019 Pro