Formatting chart TickLabels fails to include time with date

D

deko

The data I'm trying to chart has date values in Column A that look like
this:

01/29/2005 13:23
01/29/2005 14:30
01/29/2005 15:37
01/30/2005 05:11
01/30/2005 06:17
01/30/2005 07:24
etc., etc.

After inserting this data from Access (and all the corresponding values in
Column B through whatever), I use automation to format Column A like this:

xlapp.Workbooks(strXlsFile).Worksheets(sn(i)).Range _
("A2:A" & lr).NumberFormat = "mm/dd/yyyy hh:mm;@"

I try to format the TickLabels like this:

objChart.Axes(xlCategory).TickLabels.NumberFormat = _
"mm/dd/yyyy hh:mm;@"

but the TickLabels appear like this:

01/29/2005 00:00
01/29/2005 00:00
01/29/2005 00:00
01/30/2005 00:00
01/30/2005 00:00
01/30/2005 00:00

which screws up the chart since the intra-day values are all stacked on top
of each other.

Is there any way to get the TickLabels to display the time as well as the
date? Am I applying the TickLabel formatting correctly?

Thanks in advance.
 
W

William

Hi Deko

Try amending the following to suit your needs and adding to your code.

With ActiveSheet.ChartObjects("Chart 2").Chart
..Axes(xlCategory, xlPrimary).CategoryType = xlCategoryScale
End With

-----
XL2003
Regards

William

(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top