• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Trying to create/draw a striped line

KJT

New Member
Hi,


I tend to use Excel for drawing all sorts of flowcharts, organisational charts etc, due to familiarity. I am now trying to use it to produce a wiring diagram in which the colour of each wire is correctly displayed. This is no problem, until it comes to tackling 2-colour wires (eg yellow & green striped).


The only way I've been able to achieve this effect so far, is to insert 2 lines, format each to one of the 2 colours I'm looking for, format one of the lines to "dash", format the other line to "send to back", and position the lines one on top of the other. This gives the effect of a striped line in the two colours I've chosen, but it's a bit Heath Robinson and cumbersome.


Is there a better way?


Many thanks.
 
Hi ,


It need not be cumbersome , since once you have done it , you can make that line your default line , so that the next time you insert a line , you get the same effect.


I think another way to do this is to :


1. Draw a single line.

2. Right click on the line and select Format Shape.

3. Under Line Style , select a Width of 2 pt.

4. Under Compound Type , select Double.

5. Under Dash Type , select Solid.

6. Select Line Colour , and click on Gradient.

7. Under Preset Colours , select Chrome.

8. Under Direction , select one of the diagonal options.

9. Add Gradient stops at 10 % , 20 % , 30 % ,...., 100 %.

10. Under the Gradient Stop Color , alternate between the two colours , say GREEN and YELLOW e.g. at 10 % have GREEN , at 20 % have YELLOW ,...


Though this method appears to be cumbersome , I think a VBA procedure can be written to do this , so that all you would have to do from the second time would be to select the line and press the short-cut key for the macro ; it can even prompt you for the two colours that you want.


This technique could be extended to even three or more colours.


Narayan
 
Hi Narayan,


Thanks for you help with this.


I'm a bit puzzled by your first comment, though, about setting my original approach as a default line, as it involves inserting 2 separate lines placed one on top of the other. I can't see how I could combine these 2 into one default line. Am I misunderstanding what you mean?


Your alternative also works, but the sad perfectionist in me is ideally looking for an abrupt hard transition between each of the 2 colours, rather than a graduated colour change between each stop. Also, placing 10 stops appears to be the upper limit (unless there is a way to add more than 10), so a long line inserted this way appears with no more than 10 long graduated colour segments.


I appreciate that Excel is not first and foremost a drawing tool, and others might suggest alternative software, but I use it for so many other things that I find I tend to "think" in Excel, and generally turn to it first, so was hoping to find the right solution within Excel.


Regards,


Kev
 
Hi Kev ,


Sorry , my mistake. If there were only one line , then it could be set as the default line ; with your method , there are actually two lines , because of which you cannot set the group as a default one.


However , I am sure that what you need will be readily available as an add-in. Have you googled this ?


Narayan
 
Hi Narayan,


Yes, but not really come up with anything meaningful so far.


Thanks anyway.


Kev
 
Hi Kev ,


I cannot think this is possible.


Is it possible you can upload a blank worksheet with one or two samples of the lines you have designed ? It'll give a precise idea of what you are looking for.


Narayan
 
Hi Narayan,


Have a look at:

https://www.dropbox.com/sh/4pry430liysepl8/_0e65wieQd/striped%20lines.xlsx


The line to the left is per your alternative method

The second "line" (connected to another shape at each end) is the sort of thing I'm trying to achieve, but is made up of two separate lines formated as per the individual lines shown underneath, and then placed one on top of the other, if that makes sense!


Kev
 
It's a bit cumbersome, but here's another idea.


Create 2 rectangles with no lines, interior color set to the 2 colors you want to use. Align them next to each other, then group. Copy the grouped shape (to the clipboard)


Draw another rectangle. Format, fill, Use picture. Use the clipboard, and then tile picture as texture. This will cause the 2 colors to repeat. Set the rectangle to have no line.


You end up with a rectangle technically, instead of a line, but it's the only way I could get the fill option.
 
Hi Luke,


I like the idea, but I guess I would only be able to use it as a straight "line".

Ideally I need to be able to copy the format to elbows and curved lines as well, to give me line functionality and connectivity.


See updated:

http://dl.dropbox.com/u/78882458/striped%20lines.xlsx

for elbowed and curved version added.


I guess I may need to stick to the way I'm doing it at present - I just hoped there was an easier way in Excel, or a suitable add-in that I hadn't yet come across.


Thanks,


Kev
 
KJT,

Do you have access to Office 2003? Looks like the pattern fill feature would have helped you, if it hadn't been taken away.

http://www.officefrustration.com/showthread.php?t=907247


Possible work-around to try and use the feature as it's still available in Word:

http://www.pptalchemy.co.uk/patterns.html
 
Hi Kev ,


Do you think this may be helpful ?


https://skydrive.live.com/edit.aspx?cid=754467BA13646A3F&resid=754467BA13646A3F%21186


I have added two shapes ; select the two shapes and run the Connect_Shapes procedure.


It's just a framework , and can probably be extended.


Narayan
 
Luke,


Not any more, unfortunately. Isn't progress great!


Narayan,


Genius - I can definitely use that!


Many thanks for all your help with this.


Regards,


Kev
 
Back
Top