I was recently asked how the color of one shape can be changed and for other shapes to be automatically updated to the same color … even if they are on different pages! Well, it is possible with Microsoft Visio’s awesome ShapeSheet formulas. In fact, this capability is not limited to the FillForegnd cell … check out the Microsoft Learn page about SETATREF(…), and view the video below to find out more.
The formula in a ShapeSheet formula of one shape can reference the value of another cell, which can be in a different shape on the same page, or even on a different page.
For example, the formula =Sheet.1004!FillForegnd will get the fill color of the shape with the ID = 1004, and, if this is entered into the FillForegnd cell of another shape, then it will be the same color. This formula could be enclosed in the GUARD(…) function, if you don’t want the color to be changed, or enclosed in a SETATREF(…) function, if you want the color to be updated on either shape to keep them synchronized.
This short video explains how this can be done with the ShapeSheet in Visio …
Of course, it does not have to be limited to the fill color….
Related articles
How to migrate from Lucidchart to Visio
I am pleased to announce that I will be presenting a webinar on Thursday 10th October 2024 where I will be demonstrating how to convert many types of diagrams from Lucidchart to Visio, and keep their smartness. Over the 30 years that I have been using and developing solutions with Visio, I have seen many…
Setting Default Measurement Units in Visio Pages
Microsoft Visio can handle many different units of measurements which can be set for a page and separately for shapes, such as dimensions, within the page. This can confuse some users who expect them both to be the same all the time. In fact, the dimension units can be set to be the same as…
Refreshing the cached installed files of Visio
I have created many Visio solutions over the past 25 years and used a number of methods of creating an installation that includes Visio templates and stencils. I have just wasted many hours trying to debug an installation created with Advanced Installer until I realised that the problem was that Visio was not properly updating…
Linking Data to Shapes in Visio after using Data Visualizer
Data Visualizer (DV) in Visio Plan 2 (Data | Create from Data | Create ) is great because it provides a way of automatically creating a diagram from data, but it also prevents some of the other data-linking features in Visio from being used. This is because DV wants to take control of the data…
Positioning Visio Shape Text Block with a Control Handle
I was recently asked how a control handle can be added to a Visio shape so that it can be used to re-position the text block. Fortunately, it is extremely easy to setup, and requires just two formulas to be updated in the ShapeSheet. This is a great use of the SETATREF(…) function. (more…)
New Requirement for VBA Digital Signatures in Visio
Like most developers, I have to buy a new digital certificate every 3 years to sign my Visio add-ins and VBA projects. Usually that means verifying my bone fides, paying the fee and downloading the certificate, but security has been increased, and now, like everyone else, I have to use a USB key with it…
john marshall says
Well written
There is also the three shapesheets —> TheSheet, ThePage and TheDoc.
So you could assign the colour to TheDoc or ThePage.