Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Conditional Formatting in Visio

1,259 views
Skip to first unread message

Andrew Ziola

unread,
Jun 12, 2003, 4:29:08 PM6/12/03
to
Does Visio have the capability to conditionally format a
box (make it red) if a specific field = a specific value?
Just like excel has.

For example, If Job Class = 123, Then make box "Red"
or "Italic Font" or whatever....

John Marshall, MVP

unread,
Jun 12, 2003, 9:26:33 PM6/12/03
to
Using the shapesheet, you can replace the constant value for the colour with
a formula that is based on a custom property. There is an example at
http://www.mvps.org/visio/VBA.htm (Look for "Colour based on status")

John... Visio MVP

Need stencils or ideas? http://www.mvps.org/visio/3rdparty.htm
Need VBA examples? http://www.mvps.org/visio/VBA.htm
Common Visio Questions http://www.mvps.org/visio/common_questions.htm
"Andrew Ziola" <andrew...@nborder.com> wrote in message
news:025c01c33121$46b53b70$a501...@phx.gbl...

Andrew Ziola

unread,
Jun 13, 2003, 12:08:57 PM6/13/03
to
thanks a ton John. makes sense actually... however, in my
ShowShapesheet view, I cannot find the "FillForegnd" cell
that is referred to by Mark Nelson...Please advise.

>.
>

Andrew Ziola

unread,
Jun 13, 2003, 12:16:40 PM6/13/03
to
found the cell...let's see how far i can get...

>.
>

Andrew Ziola

unread,
Jun 13, 2003, 2:38:40 PM6/13/03
to
Not sure on the formula format...

Here's the pseudocode of what I want to do...

The field that I want to key off (from my .xls file that
I'm importing to build this org chart and is also in the
box itself with the name) is named "CO".

IF "CO" = 172, make the shape/box foreground Blue
IF "CO" = 548, make the shape/box foreground Black
IF "CO" = 1794, make the shape/box foreground Green
ELSE
make the shape/box foreground Red

I can e-mail you my Visio file if it'd be easier...

>.
>

Mark Nelson [MS]

unread,
Jun 17, 2003, 6:50:45 PM6/17/03
to
Let's assume you put the CO information into a custom property named "CO" in
the shape. The value for CO is then stored in the Prop.CO cell.

You can then use this formula in the FillForegnd cell:
=IF(Prop.CO=172,4,IF(Prop.CO=548,0,IF(Prop.CO=1794,3,2)))

The color codes for this cell are:
0 - Black
1 - White
2 - Red
3 - Green
4 - Blue
...


--
Mark Nelson
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.


"Andrew Ziola" <andrew...@nborder.com> wrote in message

news:02b701c331db$02833d20$a301...@phx.gbl...

Andrew Ziola

unread,
Jun 20, 2003, 11:37:05 AM6/20/03
to
Mark,

Thanks for the formula. I attempted it, and I get a
formula error...see actual text I used...Perhaps I
need ""'s or something...Does the data from the excel file
need to be a specific data type? I enter this formula in
the Show Shapesheet Fill Format area (Fill Foregnd cell)
after I've selected 'all the boxes' in the org chart

=IF(Prop.CO=172,4,IF(Prop.CO=548,2,IF(Prop.CO=1794,3,IF
(Prop.CO=60,0,1))))

Can I send the small file to you?

Is there a property that I need to verify for this
functionality to work?

Thanks for your help!

Andrew

>-----Original Message-----
>Let's assume you put the CO information into a custom
property named "CO" in
>the shape. The value for CO is then stored in the
Prop.CO cell.
>
>You can then use this formula in the FillForegnd cell:
> =IF(Prop.CO=172,4,IF(Prop.CO=548,0,IF(Prop.CO=1794,3,2)))
>
>The color codes for this cell are:
>0 - Black
>1 - White
>2 - Red
>3 - Green
>4 - Blue

>....

>.
>

Mark Nelson [MS]

unread,
Jun 24, 2003, 1:50:19 PM6/24/03
to
Actually Visio is pretty good about doing data type conversion so I would be
surprised if that were the problem.

Feel free to e-mail me a Visio file with your shape. (Remove the online
word from my address.)

--
Mark Nelson
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.


"Andrew Ziola" <andrew...@nborder.com> wrote in message

news:0cc301c33741$cd2a28c0$a501...@phx.gbl...

0 new messages