Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Activechart.SetSourceMethod problem

Hi

I'm trying to write a sub-procedure that creates charts based o
variables entered from a userform. Two of the variables specify a dat
range for which the graph should plot. This therefore means that I nee
to use two ranges within the source parameter of the SetSourceDat
method - one for the headings, and one for the data itself, whic
begins a variable number of rows below the headings. As well as this
there are a variable number of column sets which contain similar dat
but for different reporting areas.

i.e. something like this:

Activechart.SetSourceData Sheet1.Range(FromColumn & "2:" & ToColumn
"3" _ 'setting the headings from rows 2 and 3
' and then the second range grabbing the data:
, FromColumn & FromRow & ":" & ToColumn & ToRow), xlColumns

etc.

Unfortunately, when it creates the graph, its not recognising it as tw
distinct ranges, but creating one graph using the entire number of row
in the current region for the specified columns.

I've no doubt I'm being extremely dim and its right in front of me, bu
if someone could point me to a solution, that would be appreciated.

Thanks

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Activechart.SetSourceMethod problem

The foll. (adapted from the help file) works fine for me:

Charts(1).SetSourceData Source:=Sheets(2).Range("a1:b1,a6:b10"), _
PlotBy:=xlColumns

You should check the values of the various variables you use as well as
the final range address that you put together.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article , grinning_crow
says...
Hi

I'm trying to write a sub-procedure that creates charts based on
variables entered from a userform. Two of the variables specify a date
range for which the graph should plot. This therefore means that I need
to use two ranges within the source parameter of the SetSourceData
method - one for the headings, and one for the data itself, which
begins a variable number of rows below the headings. As well as this,
there are a variable number of column sets which contain similar data
but for different reporting areas.

i.e. something like this:

Activechart.SetSourceData Sheet1.Range(FromColumn & "2:" & ToColumn &
"3" _ 'setting the headings from rows 2 and 3
' and then the second range grabbing the data:
, FromColumn & FromRow & ":" & ToColumn & ToRow), xlColumns

etc.

Unfortunately, when it creates the graph, its not recognising it as two
distinct ranges, but creating one graph using the entire number of rows
in the current region for the specified columns.

I've no doubt I'm being extremely dim and its right in front of me, but
if someone could point me to a solution, that would be appreciated.

Thanks.


---
Message posted from http://www.ExcelForum.com/


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Activechart.SetSourceMethod problem

Check my responses in the charting group.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
http://PeltierTech.com/Excel/Charts/
_______

grinning_crow < wrote:

Hi

I'm trying to write a sub-procedure that creates charts based on
variables entered from a userform. Two of the variables specify a date
range for which the graph should plot. This therefore means that I need
to use two ranges within the source parameter of the SetSourceData
method - one for the headings, and one for the data itself, which
begins a variable number of rows below the headings. As well as this,
there are a variable number of column sets which contain similar data
but for different reporting areas.

i.e. something like this:

Activechart.SetSourceData Sheet1.Range(FromColumn & "2:" & ToColumn &
"3" _ 'setting the headings from rows 2 and 3
' and then the second range grabbing the data:
, FromColumn & FromRow & ":" & ToColumn & ToRow), xlColumns

etc.

Unfortunately, when it creates the graph, its not recognising it as two
distinct ranges, but creating one graph using the entire number of rows
in the current region for the specified columns.

I've no doubt I'm being extremely dim and its right in front of me, but
if someone could point me to a solution, that would be appreciated.

Thanks.


---
Message posted from http://www.ExcelForum.com/


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
Excel 2007 - ActiveChart.Export blurry images. EG18349276 Charts and Charting in Excel 3 August 7th 08 01:16 PM
ActiveChart.Location help Dave Excel Discussion (Misc queries) 1 November 16th 07 07:38 PM
charting problem with activechart.setsourcedata Mary Kathryn Excel Discussion (Misc queries) 4 February 25th 06 08:54 PM
How does the ActiveChart.Location() work Ramil[_2_] Excel Programming 0 January 20th 04 04:56 PM
Argument List Of ActiveChart.Location And ActiveChart.ChartType Mo[_3_] Excel Programming 2 September 1st 03 11:12 PM


All times are GMT +1. The time now is 04:25 PM.

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"