+ Reply to Thread
Results 1 to 2 of 2

Code to plot a chart from a data set with a variable number of rows

  1. #1
    Registered User
    Join Date
    11-23-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2010
    Posts
    15

    Code to plot a chart from a data set with a variable number of rows

    Hi folks,

    I'm sorry if this has been solved elsewhere, but every time I try to do a forum search I get an internal server error and it's driving me a little crazy.

    My problem is this: I have a base spreadsheet which I'm dumping a whole lot of data into and I'm running a macro to do lots of data handling. Everything is working fine with that. What I want to add in is the capability to automatically plot some charts (XY scatter, no markers) using columns A,B,L,M,N where A is the X axis. I've no problem getting a code to plot a chart, my issue is defining the range for use in the chart. If it was always the same number of rows I'd be laughing but sometimes this data set will have 500 rows, other times it could have upwards of 5,000. Is there a snippet of code out there that would allow me to select a variable number of rows? I've tried selecting the entire column and that doesn't seem to work.

    Thanks,
    Michael

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Code to plot a chart from a data set with a variable number of rows

    Create dynamic named ranges, via code, for the chart series.

    Creating Dynamic Named Ranges in VBA

    Creating Dynamic Named Ranges in VBA, part 2
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

+ 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