+ Reply to Thread
Results 1 to 2 of 2

Attach cell values to each label on axis

  1. #1
    Registered User
    Join Date
    01-14-2014
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    45

    Attach cell values to each label on axis

    Hello,

    I am hoping to attach a cell value to the axis labels, along with the colour (red/black). I have many graphs to make so I can't possibly create a text box for each and manually align them under each label. So in the attached workbook, I want "50%" to appear under "A" on the x-axis, "8%" to appear under "B", "-13%" (in red) to appear under "C" and so on. Can anyone help me please??

    Thanks a lot in advance!

    Percentage in axis.xlsx

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

    Re: Attach cell values to each label on axis

    Here's an easy way to do it without VBA but with a caveat; it surrounds the negative percentages with parenthesis instead of displaying in red font.
    • Insert a new column B to concatenate the Product with the Percent Change
    • New column B formula: =A2& " " & CHAR(10) & TEXT(E2,"0%_ ;""(""-0%)")
    • Change the chart data source to use column B for the X axis instead of column A
      =SERIES(Sheet1!$C$1,Sheet1!$B$2:$B$6,Sheet1!$C$2:$C$6,1)



    Untitled.png
    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.

+ 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 Axis Label according to 2 cell values
    By CobraLAD in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 11-26-2014, 10:15 AM
  2. Replies: 1
    Last Post: 09-30-2013, 09:52 AM
  3. attach labels to secondary x-axis values
    By ehamike in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 11-14-2009, 08:01 PM
  4. How to attach labels to each value in a Chart on the x Axis in VBA
    By Ace of Clubs in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 07-19-2009, 07:45 PM
  5. attach a label to the lines in my excel chart
    By Android in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-05-2007, 07:57 PM
  6. Axis label that corresponds to cell
    By pete3589 in forum Excel General
    Replies: 3
    Last Post: 11-10-2005, 05:45 PM
  7. cell values as label captions
    By Rbp9ad in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-10-2005, 05:10 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