Article ID: 185177
Article Last Modified on 6/17/2005
C3: D3: Region 1 E3: Region 2 F3: Region 3
C4: Jan D4: 10 E4: 80 F4: 15
C5: Feb D5: 20 E5: 70 F5: 25
C6: Mar D6: 30 E6: 60 F6: 35
C7: Apr D7: 40 E7: 50 F7: 45
Sub CreateChart()
' Create a New Chart.
Charts.Add
' Change the Chart Type to the desired type.
ActiveChart.ChartType = xlColumnClustered
' Sets the Source Data to the Region of data starting with the
' top-left corner C3. This line of code assumes that the
' region of cells is contiguous - without empty rows or columns.
ActiveChart.SetSourceData _
Source:=Sheets("Sheet1").Range("C3").CurrentRegion, _
PlotBy:=xlColumns
End Sub
176476 OFF: Office Assistant Not Answering Visual Basic Questions
181058 OFF98: How to Run Sample Code from Knowledge Base Articles
Additional query words: XL98
Keywords: kbhowto kbprogramming KB185177