+ Reply to Thread
Results 1 to 12 of 12

Formula or macro to insert maximum value of a chart axis to a spreadsheet cell

  1. #1
    Forum Contributor
    Join Date
    05-25-2019
    Location
    Sioux Falls, South Dakota
    MS-Off Ver
    Microsoft 365
    Posts
    188

    Formula or macro to insert maximum value of a chart axis to a spreadsheet cell

    I need the maximum value of 700 on the attached chart axis to be automatically entered into the E3 cell. Is there a way to do that via an excel formula or VBA?

    On the attached chart, I would like to be able to click on the check box in cell D4 to enable cell C4 to have same max value of 700.
    Attached Files Attached Files

  2. #2
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,310

    Re: Formula or macro to insert maximum value of a chart axis to a spreadsheet cell

    Possibly with...
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    05-25-2019
    Location
    Sioux Falls, South Dakota
    MS-Off Ver
    Microsoft 365
    Posts
    188

    Re: Formula or macro to insert maximum value of a chart axis to a spreadsheet cell

    Dangelor,

    Thanks, that does work. However, I was hoping that the E3 cell would always be filled with the latest maximum value. In other words, that it would be updated anytime the chart itself is updated.

    Sorry, I wasn't clear on the first post on this.

  4. #4
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,310

    Re: Formula or macro to insert maximum value of a chart axis to a spreadsheet cell

    Try it in the worksheet's code module. Should work as soon a you click on any cell after changing the chart's value.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    05-25-2019
    Location
    Sioux Falls, South Dakota
    MS-Off Ver
    Microsoft 365
    Posts
    188

    Re: Formula or macro to insert maximum value of a chart axis to a spreadsheet cell

    Yes. This code does work when I click on another cell after having TRUE be entered in the E3 cell.

    However, an unfortunate event occurs every time a chart value is changed or another cell is clicked on. The vertical axis expands another notch and the line graph flattens out. And the secondary chart does not match the Max axis value seen on the chart itself.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    05-25-2019
    Location
    Sioux Falls, South Dakota
    MS-Off Ver
    Microsoft 365
    Posts
    188

    Re: Formula or macro to insert maximum value of a chart axis to a spreadsheet cell

    Just to be clear, I'd like the E3 cell to always have the latest maximum vertical axis value in it. On this attached graph, I also had wanted the value in the C4 cell to match the Max vertical value on the chart itself. Also, I noticed that the E3 cell has a lower value than the max value shown on the chart. Not sure why that is like that...

  7. #7
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,310

    Re: Formula or macro to insert maximum value of a chart axis to a spreadsheet cell

    Interesting... if you remove the formula in C4 it works as it should. What is the purpose of that formula?

  8. #8
    Forum Contributor
    Join Date
    05-25-2019
    Location
    Sioux Falls, South Dakota
    MS-Off Ver
    Microsoft 365
    Posts
    188

    Re: Formula or macro to insert maximum value of a chart axis to a spreadsheet cell

    I'm just looking for a way for the chart to continue auto adjusting properly regardless of how high a value in the C column is.
    Last edited by Dbroek; 05-12-2020 at 01:04 PM.

  9. #9
    Forum Contributor
    Join Date
    05-25-2019
    Location
    Sioux Falls, South Dakota
    MS-Off Ver
    Microsoft 365
    Posts
    188

    Re: Formula or macro to insert maximum value of a chart axis to a spreadsheet cell

    Hxxxxxx ssss
    Last edited by Dbroek; 05-12-2020 at 01:03 PM.

  10. #10
    Forum Contributor
    Join Date
    05-25-2019
    Location
    Sioux Falls, South Dakota
    MS-Off Ver
    Microsoft 365
    Posts
    188

    Re: Formula or macro to insert maximum value of a chart axis to a spreadsheet cell

    I consider this post solved since my original request was for the max value to be placed inside an excel cell.
    dangelor, thank you much for your input.

  11. #11
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,310

    Re: Formula or macro to insert maximum value of a chart axis to a spreadsheet cell

    Sorry I wasn't much help, though I'd be curious to know why that happened.

  12. #12
    Forum Contributor
    Join Date
    05-25-2019
    Location
    Sioux Falls, South Dakota
    MS-Off Ver
    Microsoft 365
    Posts
    188
    Quote Originally Posted by dangelor View Post
    Sorry I wasn't much help, though I'd be curious to know why that happened.
    Not a problem at all. Seems that the chart doesn’t like having a Secondary axis to have the same value as its max value on the chart.

    No big deal, I’m just fine with it as it is. Was just wondering if it would work.

+ 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. Maximum Axis reference to a cell?
    By danfleysher in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 08-08-2018, 01:21 PM
  2. Replies: 1
    Last Post: 06-21-2016, 12:26 AM
  3. Replies: 0
    Last Post: 07-09-2015, 06:21 AM
  4. Maximum display in y axis of chart
    By langdon37 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 03-15-2009, 02:43 AM
  5. Macro to set y-axis maximum to user-defined value
    By lingyai in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-07-2007, 09:04 PM
  6. formula for defining axis maximum and increments
    By Nick Turner in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 03-20-2005, 06:06 PM
  7. Replies: 1
    Last Post: 02-08-2005, 06: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