+ Reply to Thread
Results 1 to 3 of 3

Excel chart that has min/max values based on cell data

Hybrid View

  1. #1
    Registered User
    Join Date
    05-14-2008
    Posts
    7

    Excel chart that has min/max values based on cell data

    I am trying to build a chart that has the x/y min/max values tied directly to cell values. I located code that will allow this, but I am having difficulties applying it and placing it correctly.

    My desire to have hours (and date due to capability to handle the values when it crosses a date), but I want the hours in even hours (ie 0100, 1500, etc). I can get the worksheet to calculate the values that I want for min/max, but I don't even know how to begin to get that spread into an interval that equate to even hours on the axis.

    I don't even know if want I want to accomplish is possible, but I have attached my work in progress that explains what I am trying to complete. I think that my cell notes explain what the values are....

    Thanks for all of the help!
    Buster
    Attached Files Attached Files
    Last edited by Buster1320; 09-28-2009 at 10:55 PM.

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

    Re: Excel chart that has min/max values based on cell data

    This will update the chart, except for the MajorUnits as these are currently not calculated

    Private Sub Worksheet_Change(ByVal Target As Range)
    
        If Not Intersect(Range("A4:B14"), Target) Is Nothing Then
            With Sheets("Chart")
                With .Axes(xlCategory)
                    .MaximumScale = Range("$F$22").Value
                    .MinimumScale = Range("$F$21").Value
    '                .MajorUnit = Range("$E$4").Value
                End With
                With .Axes(xlValue)
                    .MaximumScale = Range("$D$24").Value
                    .MinimumScale = Range("$D$23").Value
    '                .MajorUnit = Range("$E$24").Value
                End With
            End With
        End If
    End Sub
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    05-14-2008
    Posts
    7

    Re: Excel chart that has min/max values based on cell data

    Andy,

    That works great! Thanks for the help...

    I figured out a way for it to calculate the major units with date/time, probably did it a longer/harder way than it had to be done.... but it does what I want it to do! At least at this stage...

    Buster
    Last edited by Buster1320; 09-28-2009 at 10:58 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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