Hey guys. I'm in the process of creating a macro that will return charts based off of data from another worksheet. Unfortunately, I keep getting an error. I'm new to the whole VBA thing and I'm not really sure why its not working.
Here's the code:
Sub Charts()
'
' Charts Macro
' Macro recorded 6/28/2012 by MAC35
'
' Keyboard Shortcut: Ctrl+Shift+H
'
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("SUMMARY").Range("B12:G17"), PlotBy _
:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:="Charts"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "VW Weekly"
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With
ActiveChart.HasDataTable = True
ActiveChart.DataTable.ShowLegendKey = False
ActiveChart.PlotArea.Select
ActiveChart.ChartArea.Select
ActiveSheet.Shapes("Chart 13").IncrementLeft -231.75
ActiveSheet.Shapes("Chart 13").IncrementTop -160.5
ActiveSheet.Shapes("Chart 13").ScaleWidth 0.92, msoFalse, msoScaleFromTopLeft
End Sub
MVB states that the error is with the first line. The error reads: compile error expected function or variable.
Thanks in advance
Bookmarks