+ Reply to Thread
Results 1 to 7 of 7

Code for creating line between two cells - Spaghetti chart

  1. #1
    Registered User
    Join Date
    12-20-2007
    Posts
    10

    Code for creating line between two cells - Spaghetti chart

    Hi All,

    I wanted to make a spaghetti chart (to show amount of transportation waste in a process), but found that the manual way is too tedious...this led to the thought of automation...and since I dont know anything about VB...here I am.

    Situation: Column A and Column B have numbers as following
    1 5
    2 3
    3 4
    2 5 ... and so on.

    These numbers are actually process steps.
    In another corner of the sheet, the steps are mentioned as following in adjoining cells and others in couple of rows below...

    1 2 3 4 5

    6 7 8 9 10....assuming there are only 10 process steps.

    What I want is that in the numbers entered in column A and B should result in a curve line linking the relevant cells...as in above example...a curve line links 1 and 5...
    If I have confused you, pls let me know and I will try and upload an example of what I want.

    Thanks in advance...
    Last edited by VBA Noob; 06-19-2008 at 11:36 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436
    If I have confused you
    Yes you have
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    12-20-2007
    Posts
    10

    Hope this helps...

    Uploading the example sheet
    Attached Files Attached Files

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436
    The attached is a simply xy-scatter.
    Is this what you need?
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-20-2007
    Posts
    10

    This definitely works

    How did you do this? Could not figure out...tell me pls...

  6. #6
    Registered User
    Join Date
    12-20-2007
    Posts
    10

    Also...

    instead of straight lines can we have Curves...

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436
    It's just a xy-scatter.

    The 2 rows of points 1-5 and 6-10 are created using the data in B23:C32

    The actually line is created by using the coordinates for each connecting line.

    The line is already curved. The reason it does not show as curved is because of the gaps in the data. You can only create a curve when you plot a minimum of 3 consecutive points. Problem is working out the route of connections so you only go through each point once. This may not actually be possible.

    What information does the curved line bring that the straight does not?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1