+ Reply to Thread
Results 1 to 4 of 4

Format Axes VBA

  1. #1
    Forum Contributor
    Join Date
    11-09-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    390

    Format Axes VBA

    Hi All,

    I have created a chart on a userform with VBA and formatted using following code

    Please Login or Register  to view this content.
    As you can see in the last line I formatted the Y-axis values by thousands smaller. there is a word 'Thousands' appears on top of my Y-Axis which I want to get rid of. Do you know what code should I use to remove that. Is there something like .Axes.DisplayUnote.Title = False or something like that?

    P.S. How can I change the style of the graph to a fancier style or change the background color?

    Any help much appreciated.

    Thanks,

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

    Re: Format Axes VBA

    Please Login or Register  to view this content.
    Have you tried using the macro recorder to help get some the syntax when doing fancier things?

    Background colour could relate to chartarea or plotarea. So something along the lines of

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Format Axes VBA

    Change your code to:
    Please Login or Register  to view this content.
    See additional line in red (and I've added a couple of With...End With groups for dealing with each axis more efficiently.

    What do you mean by "fancier style"? Maybe attach an example of what you have, and what you would like?
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  4. #4
    Forum Contributor
    Join Date
    11-09-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    390

    Re: Format Axes VBA

    Thank you both. Both ways work! Cheers

+ 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. Custom number format code for hiding specific values on chart axes
    By rob_storrar in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 11-25-2012, 12:27 AM
  2. Format primary and secondary axes with VBA
    By KATIEexcel in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-15-2012, 08:28 AM
  3. Format primary and secondary axes with VBA
    By KATIEexcel in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-15-2012, 06:33 AM
  4. Format Axes Titles - Characters
    By judicial85 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-17-2010, 06:29 PM
  5. [SOLVED] Show 'incomplete' axes & show ticks but NOT axes?
    By Jay in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-13-2006, 11:50 AM
  6. How do I format the x axis on a "lines on 2 axes" chart?
    By Becky B in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-05-2006, 05:30 PM
  7. Y Axes
    By Tony in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 06-09-2005, 02:05 PM
  8. How can i get the MAX value for the Y and X axes ?
    By Radixa in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 04-20-2005, 09: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