Consulting

Results 1 to 7 of 7

Thread: greatest date and time

  1. #1

    greatest date and time

    I'm trying to set the X-Axis scale of a chart to set based on the greatest date/time in a column, but am not having good luck. Here's what I have:

    'X-Axis
    With ActiveChart.Axes(xlCategory)
    .Select
    .MinimumScaleIsAuto = True
    .MaximumScale = DateValue(DateAdd("e", 1, dtDate))
    End With

    Sample date & time entry:

    6/28/2007 9:22:18 AM

    The entries are in the E column


    Thanks
    6/28/2007 9:22
    6/28/2007 9:22
    6/28/2007 9:22

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Doesn't the cahrt base itself upon those dates automatically?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Yea, but not very well. It usually seems to leave a lot off blank space to the right, thats why I'm trying to base the maxscale to the date/time.

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Can you post a workbook example?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    Alright, I posted the file as an attachment. I'm trying to find the maximum date and time value in column E. Thanks

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    That workbook threw up loads of do you want to delete dialogs, the chart was then referencing #REF, so all in all it was not a lot of use to me.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #7
    Sory about that, it gets kinda messy sometimes. This was someone elses project, and I'm just trying to clean it up. I'm completely new to vba.

    Here is a refresh of the file. There shouldnt be any sheet deletion warnings now. There are some cells with ###, but they do have date/time values.

    Thanks again for the help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •