Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
help with chart
hi i can create a chart with one set of data from range a1 to a10 using the
below code can someone please advise me how to add a second set of data to the the chart i.e so the full data range woul be from a1 to b10 Public Sub cSheet() Dim dataRange As Range Set dataRange = Range("A2:a10") Charts.Add With ActiveChart .HasTitle = True .ChartTitle.Characters.Text = "hello" .ChartType = xlColumnClustered .HasLegend = True .Legend.Position = xlRight .Axes(xlCategory).MinorTickMark = xlOutside .Axes(xlValue).MinorTickMark = xlOutside .Axes(xlValue).MaximumScale = Application.WorksheetFunction.RoundUp(Application. WorksheetFunction.Max(dataRange), -1) .Axes(xlCategory).HasTitle = True .Axes(xlCategory).AxisTitle.Characters.Text = "Harry" .Axes(xlValue).HasTitle = True .Axes(xlValue).AxisTitle.Characters.Text = "Andy" .SeriesCollection(1).Name = "Sample Data" .SeriesCollection(1).Values = dataRange End With End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
help with chart
You can change the line below;
Set dataRange = Range("A2:a10") to Set dataRange = Range("A2:B10") If you want to do this in a seperate series post back and i'll give you some more code. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
copy chart formatting and chart templates in Excel 2007 | Charts and Charting in Excel | |||
Dynamic chart- curve dropping to zero ( chart type- Line) | Charts and Charting in Excel | |||
Excel 2003 is missing Built-In Custom Chart Types in Chart Wizard | Charts and Charting in Excel | |||
Excel 2003 is missing Built-In Custom Chart Types in Chart Wizard | Setting up and Configuration of Excel | |||
Cannot Activate Chart Area in Chart. Chart Object Failed | Excel Programming |