Shapesheet function to push values in to other cell from user cell?

Started by Visisthebest, October 03, 2023, 09:15:14 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Visisthebest

Is there a function like SETATREF that can push a value in to another cell, but from a user cell?

SETATREF is not supported in user cells according to Microsoft:
https://learn.microsoft.com/en-us/office/client-developer/visio/setatref-function

Cannot use SETF as that would destroy the SETATREF in the target cell.

Any ideas about how to push a value in to another cell directly from a user cell?
Visio 2021 Professional

wapperdude

Quote from: Visisthebest on October 03, 2023, 09:15:14 AM
Cannot use SETF as that would destroy the SETATREF in the target cell.

Is the target cell a valid host cell?  I presume by "target", you actually mean " host", i.e., the cell containing the SETATREF formula. 

The setatref formula, ought to have a target cell, an indicated place to place to hold the value that is actually displayed in the host cell. This target cell can be a user cell.  It is possible to change this user cell value directly without slobbering the host cell formula.  However, if there is some change that triggers the host cell, it will overwrite the user cell. 

If that's not desired, then what's the point of preserving or even having the SETATREF fcn? 

There is a possible IF statement use case if there is a conditional situation that selects using SETATREF or not.
Visio 2019 Pro

Visisthebest

The target cell is the cell the value needs to pushed in to, so another cell than the cell containing/hosting the formula, the value is pushed in to the target cell like PinX.
Visio 2021 Professional

Visisthebest

Visio 2021 Professional

wapperdude

To  give specific example of what I previously indicated. 

In the PinX cell, formula => SETATREF(User.MyPinX,SETATREFEVAL(SETATREFEXPR())).  Upon 1st move, User.MyPinX gets a value, and this is shoved into SETATREFEXPR().

In another data cell, say Prop.Init_PinX, there could be SETATREF(User.MyPinX,SETATREFEVAL(SETATREFEXPR())), that would send a value.   PinX formula would update accordingly, but formula stays intact.  Note, if shape is manually moved, the new location flushes into the Data and the Prop cells.

Or/and, in another User cell, say User.Init_PinX, put SETF(GETREF(User.MyPinX), a value).  If/when this user cell gets triggered, the User.MyPinX gets updated and flushes into the actual PinX, and shape moves accordingly.  Subsequent re-positioning of the shape, will not impact this User cell, but, PinX formula is alive, and will update the User.MyPinX, plus the Prop cell if it exists.
Visio 2019 Pro

Visisthebest

Thank you Wapperdude this is a clever solution that I can use!
Visio 2021 Professional