+ Reply to Thread
Results 1 to 6 of 6

Macro Modify to Include X-Axis

  1. #1
    Registered User
    Join Date
    02-06-2013
    Location
    U.S.
    MS-Off Ver
    2013
    Posts
    66

    Macro Modify to Include X-Axis

    Hey guys, I have a macro that will change the font size of every Y-Axis on the chart on the active sheet. It works wonderfully, but I also need to include the X-Axis as well. Is there a way to make this change the font size of both X and Y Axis?

    Please Login or Register  to view this content.
    Last edited by comp; 05-25-2016 at 02:12 PM.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Macro Modify to Include X-Axis

    Simply add another With block that works on the cht.axes(xlcategory).... object. https://msdn.microsoft.com/en-us/lib.../ff821055.aspx
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    02-06-2013
    Location
    U.S.
    MS-Off Ver
    2013
    Posts
    66

    Re: Macro Modify to Include X-Axis

    i tried this, but it says "For Control variable already in use"

    can someone provide an example of a correctly modified macro?

    Please Login or Register  to view this content.

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Macro Modify to Include X-Axis

    And the error is exactly right -- you are trying to nest a For each sht..Next sht loop within another For each sht..Next sht loop.
    Please Login or Register  to view this content.
    As noted in teh code, I'm not sure why you are looping through the shts twice. I would loop through the sheets and chart objects once, and modify both axes during each loop.

  5. #5
    Registered User
    Join Date
    02-06-2013
    Location
    U.S.
    MS-Off Ver
    2013
    Posts
    66

    Re: Macro Modify to Include X-Axis

    I appreciate the help, but I do not know how to write macros very well, and I tried running that and came up with the same issue. Can someone please help with an example of something that i can run?

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Macro Modify to Include X-Axis

    Please Login or Register  to view this content.

+ 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. Macro Modify to Include X-Axis [DATABASE ERROR]
    By comp in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-26-2016, 04:29 PM
  2. [SOLVED] Modify Macro to include cells in range instead of one cell
    By fpt264 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-05-2016, 05:44 PM
  3. Replies: 2
    Last Post: 11-03-2014, 12:06 PM
  4. [SOLVED] Macro Code - Modify to include > or = to
    By SVTF in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-22-2014, 05:18 PM
  5. [SOLVED] Modify Macro Code to include an extra Pop Up with different trigger
    By SVTF in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-15-2014, 11:49 AM
  6. Replies: 2
    Last Post: 07-14-2014, 11:11 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