Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Please help w/ VBA charting and dates on x-axis.
hi,
i'm trying to create charts and add series using VBA and reading from cells from a different worksheet in the workbook. I have it all figured out, but when i try and read the dates from the cells using this: Sheet8.Range(Sheet8.Cells(2, 2), Sheet8.Cells(2, 18)) or this: Sheet8.Range(Sheet8.Cells(FirstColumn, FirstRow), Sheet8.Cells(FirstColumn, LastRow)), i get dates that are all over the place and look more like julian dates, but when i use this: .XValues = Sheet8.Range("B2:B18"), it works fine. Could someone please tell me what the issue is with this and a workaround if you know of one. My example is below. Thanks, Lee Holsenbeck 'Hard code the column value for the Y axis YColumn = "6" 'Add a series ChtObj.Chart.SeriesCollection.NewSeries With ChtObj.Chart.SeriesCollection(1) 'Get the Y axis values from worksheet 8 .Values = Sheet8.Range(Sheet8.Cells(FirstRow, YColumn), Sheet8.Cells(LastRow, YColumn)) 'Sample Y axis values '.Values = Sheet8.Range(Sheet8.Cells(2, 6), Sheet8.Cells(18, 6)) 'Get the X axis values from worksheet 8 .XValues = Sheet8.Range(Sheet8.Cells(FirstColumn, FirstRow), Sheet8.Cells(FirstColumn, LastRow)) 'Sample x axis values '.XValues = Sheet8.Range(Sheet8.Cells(2, 2), Sheet8.Cells(2, 18)) '.XValues = Sheet8.Range("B2:B18") .Interior.ColorIndex = 3 .Border.ColorIndex = 3 .Name = "Gross Oil/Cond" End With |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
charting with a secondary Y axis | Excel Discussion (Misc queries) | |||
Charting dates on the Y axis without weekends | Charts and Charting in Excel | |||
Charting in 4 different axis | Charts and Charting in Excel | |||
Charting data against dates where dates are not at fixed intervals | Charts and Charting in Excel | |||
Charting with Two Axis | Charts and Charting in Excel |