Code:
Sub ACGC()
'
' ACGC Macro
'
'
Sheets(Sheets.Count).Select
Sheets.Add
ActiveSheet.Name = "ACGC Graph"
Cells.Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range("A1").Select
Sheets("VWAP").Select
Range("B5:B6").Select
Range(Selection, Selection.End(xlToRight)).Select
ActiveSheet.Shapes.AddChart2(227, xlLineMarkers).Select
ActiveChart.SetSourceData Source:=Range("VWAP!$B$5:$Q$6")
[COLOR=#0000ff]ActiveChart.FullSeriesCollection(1).XValues = "==VWAP!Date"
ActiveChart.FullSeriesCollection(1).Values = "==VWAP!ACGC"[/COLOR]
ActiveChart.Parent.Cut
Sheets("ACGC Graph").Select
Range("B4").Select
ActiveSheet.Paste
End Sub
I get an application defined or object defined error when I try to run the code above. Can you please help? I have already defined the names using the name manager, so can't see a reason for this?
Thank you
Last edited by a moderator: