+ Reply to Thread
Results 1 to 3 of 3

Changing chart property through macro

  1. #1
    Registered User
    Join Date
    09-28-2016
    Location
    Vancouver, Canada
    MS-Off Ver
    2016
    Posts
    2

    Red face Changing chart property through macro

    Hi everyone,

    I'm pretty new to programming in Excel, and I'm facing a challenge. I'm having trouble changing a chart property through a macro which is run by a button.

    The issue seems to be that when I press the button to run the macro, it doesn't seem to be able to identify the chart, even though it appears to have the name "Chart 1" that I try to reference it by. I get error "Run-time error 9, Subscript out of range". I'm posting an image below of the macro and the chart.

    macro_image.png

    Note: I'm trying to change "Axis value" under the "Vertical axis crosses" section of "Axis options" through the macro, since it will be taken from a cell that may change in value.

    Any help is greatly appreciated

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Changing chart property through macro

    Hi and welcome to the forum.

    Try this...
    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    09-28-2016
    Location
    Vancouver, Canada
    MS-Off Ver
    2016
    Posts
    2

    Re: Changing chart property through macro

    Thank you very much, that solved it :D

+ 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] changing bar chart color through macro
    By siddiqsh in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-02-2015, 01:26 PM
  2. Changing control property in a macro, getting error 424 Object required
    By JCMus in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-07-2014, 03:10 PM
  3. Changing The Tag property Permanently
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-24-2011, 08:02 AM
  4. Changing chart selection using macro
    By zapp7 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 11-01-2010, 11:58 AM
  5. Error 1004 - Axisgroup property problem with chart macro
    By kostas in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 04-08-2009, 10:35 AM
  6. Please HELP me with changing chart values from a Macro.
    By thedryden in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-21-2007, 07:30 PM
  7. Changing Chart Axes using a macro
    By AndrewCrisp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-28-2006, 06:29 PM

Tags for this Thread

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