wwrightchess
New Member
- Joined
- Apr 20, 2022
- Messages
- 29
- Office Version
- 365
- Platform
- MacOS
I am trying to change the data range on a series of charts but I get error 1004 which usually means I am missing a command. Here is the code
Sheets("GlennICE_output").Select
lr = Cells(Rows.Count, 1).End(xlUp).Row
Workbooks(partName).Activate
With Workbooks(partName).Charts("cp_plot")
.SeriesCollection(1).XValues = "C2:C" & lr
.SeriesCollection(1).Values = "P2:P" & lr
End With
The error is on
.SeriesCollection(1).XValues = "C2:C" & lr
lr is declared long and parname is a string
Sheets("GlennICE_output").Select
lr = Cells(Rows.Count, 1).End(xlUp).Row
Workbooks(partName).Activate
With Workbooks(partName).Charts("cp_plot")
.SeriesCollection(1).XValues = "C2:C" & lr
.SeriesCollection(1).Values = "P2:P" & lr
End With
The error is on
.SeriesCollection(1).XValues = "C2:C" & lr
lr is declared long and parname is a string