Labels in Column Chart VB

Joined
Aug 28, 2008
Messages
2
Reaction score
0
Code:
Set ChartApp = ws.ChartObjects.Add(20, 20, 300, 200)
ChartApp.Chart.ChartWizard Source:=ws.Range("k447:k450"), _
gallery:=xlColumn, HasLegend:=False, Title:="Chart1"

How do specify a range for labels? It defaults to 1, 2, 3, and 4.

i.e. xaxis.datalabels.text=range("A1:A4")

Thank you...
 
I figured it out

Code:
                    Set ChartApp = ws.ChartObjects.Add(20, 20, 300, 200)
                    With ChartApp.Chart
                        .ChartType = xlColumnClustered
                        .SetSourceData Source:=ws.Range(ws.Cells(447, "J"), ws.Cells(450, "J"))
                        .SeriesCollection(1).XValues = "=sheet1!R447C4:R450C4"
                        .SeriesCollection(1).Values = "=sheet1!R447C10:R450C10"
                        '.Location Where:=xlLocationAsObject, Name:="Sheet1"
                        .HasTitle = True
                        .ChartTitle.Characters.Text = "Chart1"
                        .HasLegend = "False"
                        .PlotArea.Interior.ColorIndex = 2
                    End With
 
Back
Top