KillGorack
New Member
- Joined
- Jan 23, 2006
- Messages
- 35
- Office Version
- 2016
- Platform
- Windows
I have some VBA to bind chart data
But the x axis names of each series, and their X-Axis Labels arent matching what is bound.
Image shows the bound area, and the values it comes up with.. no match!
Any ideas?
VBA Below
But the x axis names of each series, and their X-Axis Labels arent matching what is bound.
Image shows the bound area, and the values it comes up with.. no match!
Any ideas?
VBA Below
VBA Code:
' Nominal Line
With ThisWorkbook.Sheets(sht).ChartObjects("trend_" & shp).Chart.FullSeriesCollection(1)
.Name = "Nominal"
.Values = "=data!$D$" & dataLocation + 1 & ":$" & DataWidthLetter & "$" & dataLocation + 1
.XValues = "=data!$D$" & dataLocation + 6 & ":$" & DataWidthLetter & "$" & dataLocation + 6
.XValues = "=data!$D$" & dataLocation + 6 & ":$" & DataWidthLetter & "$" & dataLocation + 6
.Format.Line.Visible = msoTrue
.Format.Line.Weight = 0.25
End With
With ThisWorkbook.Sheets(sht).ChartObjects("trend_" & shp).Chart.FullSeriesCollection(1)
.Format.Line.Visible = msoTrue
.Format.Line.Weight = 0.25
.Format.Line.Visible = msoTrue
.Format.Line.ForeColor.RGB = RGB(0, 0, 0)
.Format.Line.Transparency = 0
End With
'Deviations.
With ThisWorkbook.Sheets(sht).ChartObjects("trend_" & shp).Chart.FullSeriesCollection(2)
.Name = "Deviations"
.Values = "=data!$D$" & dataLocation + 6 & ":$" & DataWidthLetter & "$" & dataLocation + 6
.XValues = "=data!$D$" & dataLocation + 6 & ":$" & DataWidthLetter & "$" & dataLocation + 6
.Format.Line.Visible = msoTrue
.Format.Line.ForeColor.RGB = RGB(0, 0, 0)
.Format.Line.Weight = 0.25
End With
With ThisWorkbook.Sheets(sht).ChartObjects("trend_" & shp).Chart.FullSeriesCollection(2)
.Format.Line.Visible = msoTrue
.Format.Line.ForeColor.RGB = RGB(0, 0, 0)
.Format.Line.Weight = 0.25
End With