PDA

View Full Version : greatest date and time



mechart87
06-12-2008, 02:01 PM
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

Bob Phillips
06-12-2008, 03:23 PM
Doesn't the cahrt base itself upon those dates automatically?

mechart87
06-12-2008, 05:24 PM
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.

Bob Phillips
06-13-2008, 01:15 AM
Can you post a workbook example?

mechart87
06-13-2008, 07:31 AM
Alright, I posted the file as an attachment. I'm trying to find the maximum date and time value in column E. Thanks

Bob Phillips
06-13-2008, 07:59 AM
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.

mechart87
06-13-2008, 08:10 AM
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.