+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    07-15-2008
    Location
    Ann Arbor
    Posts
    10

    Variable range for seriescollection.value

    I'm setting up a chart that automatically adjusts the series based on the number of rows of data. I already have my script set up to determine the last row in the worksheet that contains data--I just can't figure out how to edit the chart.

    This is the code that I've got:

    Code:
    ActiveChart.SeriesCollection(1).Values = "='Chart'!$C$2:$C$" & x
    Where x is the last row containing data.

    Thanks.
    Last edited by adamsad1; 08-19-2009 at 01:03 PM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,944

    Re: Variable range for seriescollection.value

    so does your code not work? if it errors what does the error say?
    Last edited by Andy Pope; 08-19-2009 at 12:42 PM.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    07-15-2008
    Location
    Ann Arbor
    Posts
    10

    Re: Variable range for seriescollection.value

    Hmm... Well, that's odd... It was kicking back an application/object-defined error on that line. I just ran it again and it the script worked perfectly.

    I guess maybe I just needed to close out and re-open Excel.

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.2.0