+ Reply to Thread
Results 1 to 6 of 6

Change a (F11) chart's axis values using cell values

  1. #1
    Forum Contributor
    Join Date
    04-02-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    403

    Change a (F11) chart's axis values using cell values

    Hi Guys,

    I want to be able to edit axis of a chart (a "F11" chart not a chart within a sheet) by entering in numbers within cells.
    See the "Chart1 tab" and "Chart2 tab"

    The following code words for a chart within a sheet, but I dont know how to select a chart if that chart is it's own tab.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by JimmyWilliams; 04-05-2020 at 02:26 AM. Reason: clarity
    Thanks,

    JimmyWilliams

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

    Re: Change a (F11) chart's axis values using cell values

    Try this modification to handle chart sheets and chart objects on chart sheets

    Please Login or Register  to view this content.
    Also check the cell formulas as you need to change the chart object names or use "" is a standard chart sheet.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    04-02-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    403

    Re: Change a (F11) chart's axis values using cell values

    Hi Andy,

    Super cool what you've done so far.

    How did you determine that the objects were "Chart 1" and "Chart 4" within Chart1?
    I normally need to use the "Name box" (in the top left corner) to determine an object's name. However both "Chart1","Chart 1" and "Chart1","Chart 4" don't show in the "Name box".



    A little bit off topic, I edited the code to allow for Major and Minor axis units to be determined.
    And I feel like this code repeats its self unnecessarily and could be tidier (I'm hoping to keep the code for a really long time, so it'd be nice if it was more compact, so I can add more to it /etc.)


    A little bit even more off topic,
    While you were typing your code I tried to add in Major/Minor Axis units (See below).
    However I am having trouble with optional variables as excel seems to stop working if they are not defined, I have a worked around this by using "goto line1" however this wouldn't work for more complicated programs.
    I would like a way of doing something like: "If NO-DEFINED-USER-INPUT then.."

    Can you grab what you've done with mine and put it all together?
    Please and thank you.


    Please Login or Register  to view this content.

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

    Re: Change a (F11) chart's axis values using cell values

    I used the immediate window to find the names of the shapes on the chart sheet

    Please Login or Register  to view this content.
    If you declare the optional arguments as Variant you can use the IsMissing function.

  5. #5
    Forum Contributor
    Join Date
    04-02-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    403

    Re: Change a (F11) chart's axis values using cell values

    Quote Originally Posted by Andy Pope View Post
    I used the immediate window to find the names of the shapes on the chart sheet

    Please Login or Register  to view this content.
    If you declare the optional arguments as Variant you can use the IsMissing function.

    Hi Andy,

    How do I use the code:
    Please Login or Register  to view this content.
    Do i put it into the immediate window, or into a sub?

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

    Re: Change a (F11) chart's axis values using cell values

    You would use that example bit of code in the immediate window.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Chart moves bars when axis values change
    By Ochimus in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 04-05-2015, 08:08 AM
  2. [SOLVED] Change x-axis values on Bar Chart
    By scantor145 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 03-11-2015, 06:45 AM
  3. [SOLVED] How to change y-axis of bubble chart to non-numeric values?
    By arasan25 in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 02-01-2013, 05:16 AM
  4. Change Values on X-axis for Column Chart
    By silliemillie in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 09-24-2007, 11:21 PM
  5. Can't change the scale of values on a y-axis on a line chart
    By ags in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-07-2006, 07:40 PM
  6. [SOLVED] How do I change X-Axis values in a chart with 2 Y-Axis?
    By ESGLCC in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-04-2005, 10:06 AM
  7. [SOLVED] How do I change x axis values in a line chart?
    By Elizabeth in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-29-2005, 06:06 AM

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