Human_doing
Board Regular
- Joined
- Feb 16, 2011
- Messages
- 137
Hi all,
The following code creates a simple chart using VBA:
I have the name of the department (sales) as the name of the worksheet and also in cell A2. The date of the current period is in cell A3 (Apr 10 - Mar 11). I am looking for the title of the chart to be 'Sales data Apr 10 - Mar 11' i.e. cell A2 + 'Sales data' + Cell A3, can anyone please help with the VBA for this?
Thanks
The following code creates a simple chart using VBA:
Code:
Sub Chart()
Range("H1:I13").Select
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("Sales").Range("H1:I13"), PlotBy:= _
xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:="Sales"
End With
End Sub
I have the name of the department (sales) as the name of the worksheet and also in cell A2. The date of the current period is in cell A3 (Apr 10 - Mar 11). I am looking for the title of the chart to be 'Sales data Apr 10 - Mar 11' i.e. cell A2 + 'Sales data' + Cell A3, can anyone please help with the VBA for this?
Thanks