+ Reply to Thread
Results 1 to 3 of 3

Relative cell references when creating VBA for Charts

  1. #1
    Registered User
    Join Date
    08-07-2010
    Location
    New York, U.S
    MS-Off Ver
    Excel 2003
    Posts
    3

    Relative cell references when creating VBA for Charts

    I am trying to create individual radar charts for each of the 277 students in my school. My data is set up with each student in a row and three datapoints for each name.

    I am trying to create a macro that will create a chart for each student. I need the column headings to serve as category labels on the chart, so the reference to the labels is fixed, while the data will change for each student.

    Using the Macro Recorder, I have set up the code for a single graph (see below) and then I nested this in a For To loop but can't figure out how to have the chart select the range of data for each student and then have the range change for the next student. See in particular the fourth line from the bottom ("ActiveChart.SetSourceData...")

    1. How do I write the VBA code for the chart to select the student's data? I always want the labels to be in cells A1:E2 (Absolute Reference) but then want the data to be unique for each student (Relative Reference)

    Please Login or Register  to view this content.
    Any insights would be appreciated
    Attached Files Attached Files
    Last edited by BHcristo; 08-25-2010 at 04:04 PM. Reason: Solved

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,280

    Re: Relative cell references when creating VBA for Charts

    Please Login or Register  to view this content.
    I guess.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    08-07-2010
    Location
    New York, U.S
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Relative cell references when creating VBA for Charts

    Thank you very much. This solves the issue perfectly!

+ 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