Macro To Edit Chart Elements

  • I am writing a macro to change the font and size of the axis, axis titles, legend, etc. in my excel chart. Here is what I have so far:

    Once the code gets to the point of changing the size and font of the numbers on the horizontal axis it crashes. See code above, I have put in notation where it stops working. Any help would be greatly appreciated.

  • Re: Macro To Edit Chart Elements


    it seems that there might be a bit of identification missing, based purely on previous format of your code;


    should there be something like


    HTH but apologies if I have missed your point entirely


  • Re: Edit Chart Labels

    Quote from Yard

    Welcome to Ozgrid!

    Help with what?!

    Oops, I didn't see your annotation the first time. Must get me specs cleaned....

  • Re: Macro To Edit Chart Elements

    When I step through the code (using F8) I can see it select each title and change the font and size. When the code gets to the horizontal axis where I am having problems I can see it select the correct axis, but then it fails. If I break right after it selects the code I can change the font and size manually, so the select feature works. I tried your suggestion and that also selects the correct axis and also fails once I try to change the font.[hr]*[/hr] Auto Merged Post Until 24 Hrs Passes;[dl]*[/dl]Ok got it working here. I had to reference the ticklabels...Here is the final code:

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!