KillGorack
New Member
- Joined
- Jan 23, 2006
- Messages
- 35
- Office Version
- 2016
- Platform
- Windows
Hi,
Past practices here work of course, just would like the syntax for doing this without selecting stuff.
Tried someting like... to no avail...
Past practices here work of course, just would like the syntax for doing this without selecting stuff.
VBA Code:
' Good greif can we do this without selecting stuff??!
ThisWorkbook.Sheets(sht).Select
ActiveSheet.ChartObjects("trend_" & shp).Activate
' Nominal Line
With ActiveChart.FullSeriesCollection(1)
.Name = "=data!$C$" & dataLocation + 1
.Values = "=data!$D$" & dataLocation + 1 & ":$" & DataWidthLetter & "$" & dataLocation + 1
.XValues = "=data!$D$" & dataLocation + 6 & ":$" & DataWidthLetter & "$" & dataLocation + 6
.Format.Line.Visible = msoTrue
.Format.Line.Weight = 0.25
.Format.Line.ForeColor.RGB = RGB(0, 0, 0)
End With
Tried someting like... to no avail...
VBA Code:
' Nominal Line
With ThisWorkbook.Sheets(sht).ChartObjects("trend_" & shp).FullSeriesCollection(1)
.Name = "=data!$C$" & dataLocation + 1
.Values = "=data!$D$" & dataLocation + 1 & ":$" & DataWidthLetter & "$" & dataLocation + 1
.XValues = "=data!$D$" & dataLocation + 6 & ":$" & DataWidthLetter & "$" & dataLocation + 6
.Format.Line.Visible = msoTrue
.Format.Line.Weight = 0.25
.Format.Line.ForeColor.RGB = RGB(0, 0, 0)
End With