Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy chart formatting and chart templates in Excel 2007 Astelix Charts and Charting in Excel 4 March 4th 10 04:10 AM
Dynamic chart- curve dropping to zero ( chart type- Line) vmohan1978 Charts and Charting in Excel 0 February 1st 10 09:11 AM
Excel 2003 is missing Built-In Custom Chart Types in Chart Wizard Julius Charts and Charting in Excel 2 March 6th 09 04:43 PM
Excel 2003 is missing Built-In Custom Chart Types in Chart Wizard Julius Setting up and Configuration of Excel 1 March 6th 09 01:57 AM
Cannot Activate Chart Area in Chart. Chart Object Failed [email protected] Excel Programming 2 August 8th 06 02:38 AM


All times are GMT +1. The time now is 08:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"