Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8705169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:17:32+00:00 2026-06-13T03:17:32+00:00

How do I retrieve the max and min values of an excel chart series

  • 0

How do I retrieve the max and min values of an excel chart series collection as well as the position of the same on the chart? I want to calculate where the label should be for each point in the series and move it accordingly.

I’m doing this to make them look nice, in case your wondering. The numbers tend to get all messed up if I just blindly move the labels. I’m sure I could have the number at the base of the chart, but that’s not what I’m trying to do. It doesn’t help much that the Chart object is hard to get to work with the Object Listing thing-a-ma-jig (that whatcha-ma-call-it that pops up when you hit period after an object name).

Edit: What I’m trying to achieve is the retrieval of the highest(max) and lowest(min) values of a certain series of an excel chart. I also want to get their positions on the chart itself (from the top or left). I know which way to look, but if you give the code to check which way to measure that will be a bonus. See the drawing below.

   -------------------Left------------------------------------- >
  |        ________________________________________
  |       |                                        |
  |   225 |----------------------------------------|max (highest)
  |   200 |                                        |
  |   175 |                                        |
  |   150 |            -----                       |
|Top| 125 |           /     \                      |
  |   100 |          /       \                     |
  |    75 |   -------         \                    |
  |    50 |  /                 --------------\     |
  |    25 | /                                 \    |
 \|/    0 |----------------------------------------|min (lowest)
  V       |________________________________________|
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T03:17:34+00:00Added an answer on June 13, 2026 at 3:17 am

    Well, after some more experimenting (which is one thing VBA is made for) I got it. My specific case has two bar series that are on top of each other. The code is rather long, but it is lightening fast. I think I learned a bit about how to speed up vba in the process!

    Sub AdjustReportChart()
        'main report chart
        Dim mrc As Chart
        Dim sercol As SeriesCollection
        Dim axe As Axis, ser As series
        Dim poi1 As Point, poi2 As Point
        Dim i As Integer, j As Integer
        'select the chart
        If hwb Is Nothing Then Call SetGlobals
        Set mrc = mws.ChartObjects("Chart 1").Chart
        'delave all the needed vars
        Dim poi1pos As Double, poi1val As Double
        Dim min1 As Integer, max1 As Integer
        Dim poi2pos As Double, poi2val As Double
        Dim min2 As Integer, max2 As Integer
        'get the chart width params
        Dim width As Integer
        width = Int(mrc.PlotArea.InsideWidth)
        Set sercol = mrc.SeriesCollection
        Set axe = mrc.Axes(2, sercol(1).AxisGroup)
        min1 = axe.MinimumScale
        max1 = axe.MaximumScale
        Set axe = mrc.Axes(2, sercol(2).AxisGroup)
        min2 = axe.MinimumScale
        max2 = axe.MaximumScale
        'start adjusting. 
        For j = 1 To sercol(1).points.Count
            Set poi1 = sercol(1).points(j)
            Set poi2 = sercol(2).points(j)
            poi1pos = poi1.DataLabel.Left
            poi2pos = poi2.DataLabel.Left
            poi1val = poi1.DataLabel.Text
            poi2val = poi2.DataLabel.Text
            poi1pos = (poi1val / (max1 - min1) * width - 6) + 142
            poi2pos = (poi2val / (max2 - min2) * width - 6) + 142
            If poi2pos < poi1pos + (Len(Str(poi1val)) * 6) And _
                poi1pos < poi2pos + (Len(Str(poi2val)) * 6) Then
                poi2pos = poi1pos + (Len(Str(poi1val)) * 6)
            End If
            poi1.DataLabel.Left = poi1pos
            poi2.DataLabel.Left = poi2pos
        Next j
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Within Google Spreadsheets, how can I retrieve the max and min values of a
I want to retrieve k max values from each row in a numpy array.
i want to retrieve data which their price field is between a certain max
How can I retrieve the max and min element from a queue at any
I've got a histogram in a MatND and I want to retrieve its max
Retrieve code from json. C#code:- var collection = getsortcat.Select(x => new { idterm =
I retrieve 6 values(say name, age, sex, address, id, tag) from a web service.
I retrieve a list of ObjectId and I want to retrieve all object in
I want to associate custom data to a Type, and retrieve that data in
I have a for loop in pl/sql function something like: FOR i IN min..max

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.