Color Individual Lines Of Shape Group

  • Hello,

    any idea how i could color fill a custom shape created by individual lines which are grouped together? The group behaves as one shape alright when, say, coloring the line, but is not "fillable". Below a simple sample. - The custom shape i am trying to color in is not a simple square or rectangle -not anything from the existing MS shapes that is.

    Thank you,


  • Re: Color Fill Custom Shape Group

    Use a polyline.

    [SIZE=1]Entia non sunt multiplicanda sine necessitate.[/SIZE]

  • Re: Color Individual Lines Of Shape Group

    this looks great!
    I am having difficulties understanding how this works. For practice i tried to create the same shape, same location, as in my sample, needless to say without luck. Excel's help is, well, not much help.
    May i ask if you are willing to help me further please? How would i use the approach you suggested, which i like alot, to create a shape using the data as shown in the sample in my original post, in the same location / coordinates of the sample?
    Thank you very much.

    since i have existing shapes, based on lines like in the sample. how do i translate that best?

  • Re: Color Individual Lines Of Shape Group

    Slight variation on Shg's as I used a freeform shape.
    The macro recorder provider the code.

    With ActiveSheet.Shapes.BuildFreeform(msoEditingAuto, 48, 25.5)
    .AddNodes msoSegmentLine, msoEditingAuto, 144.75, 25.5
    .AddNodes msoSegmentLine, msoEditingAuto, 144.75, 102.75
    .AddNodes msoSegmentLine, msoEditingAuto, 48.75, 102.75
    .AddNodes msoSegmentLine, msoEditingAuto, 48, 25.5
    End With


  • Re: Color Individual Lines Of Shape Group

    Just out of curiosity...

    What sort of application are you developing that requires drawing polygons with Excel?

    [SIZE="1"]Sub All_Macros(Optional control As Variant)[/SIZE]

  • Re: Color Individual Lines Of Shape Group


    I am having difficulties understanding how this works.


    The SAoP is just a list of points where (i, 1) is the x coordinate and (i, 2) is the y coordinate. Make the last point the same as the first to close the plot: SAoP(n, 1) = SAoP(1, 1) and SAoP(n, 2) = SAoP(1, 2).


    Here's an example of where I've used it. It's a field of view plot (compressed down to 50KB) of the cockpit windows of a Beech 400A from the pilot's eyepoint. Points (butt line, station, and waterline) on the window outlines were taken from a CAD drawing, re-referenced to the pilot's eyepoint, and projected to a Hammer plot.

  • Re: Color Individual Lines Of Shape Group

    Andy, shg, Aaron,
    thank you very much for all your help. This is great. Now i have a couple different ways to go about. - My goal is not as complex as what shg has shown on the "world" sample. I am just trying to build a shape similar to Draw > AutoShapes > Basic Shapes > Bevel, that allows me to color the border parts, which cannot be done individually in the said shape set up. - Now i am off to applying what i learned here.Thank you again.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!