Some formatting questions for organisational shapes

Started by Cheg, November 29, 2023, 09:02:14 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Cheg

Hi,

I have questions regarding formatting of organisational shapes using VBA.

So I have these shapes with, in each, the name of the person, then the title, a comment and the responsibility area of that person. Like this:
John John
Title: working title
Comment: some comment
Responsibility: some responsibility

Here is what I want to do:
- if the comment contains the string "XXX", I'd like the shape to be colored blue. I can get the string from the comment, it's the coloring part that I can't figure out. I tried recording a macro but found it very confusing.
- I'd like the responsibility area to be bold, but not the word "Responsibility" (so not the first 15 characters in the responsibility string).

Also, I'm looping through all the shapes including the connectors. Is it possible not to loop through the connectors but only the box shapes?

I hope it's not too many questions, otherwise I'll separate them.

hidden layer

#1
Like this?

I didn't use any vba because it works with the shapesheet only. You may change the cells upon your request.


I forgot: the name, title etc you enter with the Data of the shape (right-click at the shape -> data...)
cheers!
hl

Cheg

Hi hidden layer,

Thanks for the example. Yeah kind of, I've edited it slightly. Also how do you divide the box with horizontal bars??

But you say it's not possible to make those adjustments with VBA? The thing is, I get my organisational chart by importing data from excel using the wizard. So the format is set. I've been able to change the like the color theme but I can't figure out how to change the color of just one box.


hidden layer

Hello Cheg,
the horizontal bars are the frames of the 4 rectangles tha contains a text field each (insert -> field) whose content comes from Data.
The Group contains 4 data-rows (shapesheet -> properties) and the rectangles "look" into the shapesheet-cells of this group.
the construction is visible by rightclick -> Group -> open Group (not ungroup!)

I didn't say that this is not possible with vba. Of course is. But (similar to Excel) formulas are faster than vba.
How you get the data from Excel - that's a question for someone else.

cheers,
hl

Cheg

Hi!

Thanks a lot, I need to process your answer.
I can import the data alright from excel. The thing is, I have many boxes and I would like to avoid changing them each by hand one after the other...

I'll make an example to send here with what I get from the import.

best,
Cheg

Nikolay

#5
A basic recommendation for questions like this is to use the macro recorder,
and then modify the generated VBA code manually to fit your needs.

This button:


Have you tried that?