+ Reply to Thread
Results 1 to 6 of 6

Graph non-adjacent column data

  1. #1
    Registered User
    Join Date
    08-27-2010
    Location
    Maine
    MS-Off Ver
    Excel 2007
    Posts
    6

    Graph non-adjacent column data

    I'm trying to generate a line graph using VBA that selects data from alternating columns. I've included a spreadsheet that contains data for staff allocation (Forecast and Actual) over time.

    I'd like to be able to create a graph that plots just the forecast columns for the following rows:
    "Total Staff"
    "Total Allocation"
    "Remaining availability"

    Alternatively, I'd like to create a graph that plots a comparison of Forecast vs Actual rows:
    "Total Staff"
    "Total Allocation" and
    "Remaining availability".

    I'm having difficulties with understanding how to set the correct range.

    I'm using the following code but it's throwing an error:

    Please Login or Register  to view this content.
    thank you for your help
    Attached Files Attached Files
    Last edited by mgia0055; 08-27-2010 at 02:54 PM. Reason: Adding Code Tags

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: How do I graph non-adjacent column data ?

    Even with the code fixed you will not be able to produce a chart as the series formula for the non contiguous range will be too long.

    Instead use formula to build a contiguous range of chartable data.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    08-27-2010
    Location
    Maine
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: How do I graph non-adjacent column data ?

    Could you provide an example of how to "use a formulat to build a contiguous range of chartable data"?

    Thanks

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: How do I graph non-adjacent column data ?

    I have done a few cells so you can see what I mean.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    08-27-2010
    Location
    Maine
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: How do I graph non-adjacent column data ?

    hmm, I see what you are getting at. Is there still another approach that I could implement without creating a new table of contiguous data, say by creating a number of seperate ranges and then graph.

    What if I were to create 4 seperate ranges (one for the x axis, one for total staff, one for total allocation and one for remaining availability), could I then generate a graph that way?

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: How do I graph non-adjacent column data ?

    You might get away with 4 ranges it really depends on the sheet name and cell reference.
    As I said the series formula has a finite text length of 1024 characters.

+ 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