+ Reply to Thread
Results 1 to 2 of 2

recorded macro for chart has no x values

  1. #1
    Forum Contributor
    Join Date
    06-22-2011
    Location
    somerset
    MS-Off Ver
    365
    Posts
    328

    recorded macro for chart has no x values

    (using 2007)
    I have a large number of results sheets to go through and to check for anomalies i select all the data (5 columns) and create chart>scatter and excel gives me the chart with col 1 as x vals and 2-5 as y series vals. i then modify the axis scales etc good fine done.

    however when i have 40 of these sheets to do it can be time consuming so i figured just record a macro for creation of the chart and that would work.
    the code recorded is:
    Please Login or Register  to view this content.
    when i run the script the graph is all the correct size however now the x values have defaulted to 1,2...n and the graph has set all 5 cols to y series values.

    even odder is that if i select the box that surrounds the columns and drag it at all excel then auto sets the first column of the box to the x values as it does when i create a chart manually.

    anyone know:
    A) why it dose this? (is the macro not recording everything or is excel not performing an auto format action with macros it dose with manual work?)
    B) how to fix the script to get what i want?

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

    Re: recorded macro for chart has no x values

    Your selected data range would suggest you only selected 4 of the 5 columns.

    Col E contains X values
    Col F series 1 Y value
    Col G series 2 Y value
    Col H series 3 Y value

    Does the selected range also include series names in row 19?

    Post example workbook of your data layout.
    Cheers
    Andy
    www.andypope.info

+ 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