Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default changing the source range of a chart

Hi,

I want to be able to plot data on a radar chart, however, the number
of points varies from around 5 to 15. How can I use VBA code to reset
the source data? The source data is in a column, and I want to use
the first row to the last row (it's the last row that changes
according to the amount of data I need to chart).

Basically, I need to know how to adjust the source range using VBA?
The size of the range would be the same for the three series I plot on
the radar chart.

Hope you can help?

Thanks,
Matt
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default changing the source range of a chart

Sounds like a candidate for defined name ranges using offset
insertnamedefinename it colA or whatever.
In the refers to box
=offset($a$1,0,0,counta($a:$a),1)
in the source of the chart type in =yourworkbookname.xls!cola
Now when you add or delete from col a the range will self adjust

to add col B tied to col A length
=offset(cola,1)
etc

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"MJKelly" wrote in message
...
Hi,

I want to be able to plot data on a radar chart, however, the number
of points varies from around 5 to 15. How can I use VBA code to reset
the source data? The source data is in a column, and I want to use
the first row to the last row (it's the last row that changes
according to the amount of data I need to chart).

Basically, I need to know how to adjust the source range using VBA?
The size of the range would be the same for the three series I plot on
the radar chart.

Hope you can help?

Thanks,
Matt


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default changing the source range of a chart

On May 11, 7:43*pm, "Don Guillett" wrote:
Sounds like a candidate for *defined name ranges using offset
insertnamedefinename it colA or whatever.
In the refers to box
=offset($a$1,0,0,counta($a:$a),1)
in the source of the chart type in =yourworkbookname.xls!cola
Now when you add or delete from col a the range will self adjust

to add col B tied to col A length
=offset(cola,1)
etc

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"MJKelly" wrote in message

...

Hi,


I want to be able to plot data on a radar chart, however, the number
of points varies from around 5 to 15. *How can I use VBA code to reset
the source data? *The source data is in a column, and I want to use
the first row to the last row (it's the last row that changes
according to the amount of data I need to chart).


Basically, I need to know how to adjust the source range using VBA?
The size of the range would be the same for the three series I plot on
the radar chart.


Hope you can help?


Thanks,
Matt


Don,

When I try this I end up with a range which is three cells longer than
required. I only need the range to be as long as the column of data
(the data is continuous).
Can the source range be changed using VBA? I need to change the
source of three series of data for the same chart (all ranges will be
the same size, just in different columns).
Regards,
Matt
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default changing the source range of a chart

=offset($a$1,0,0,counta($a:$a),1)
=offset($a$1,0,0,counta($a:$a)-3,1)
or play around till you get what you want.
=offset($a$1,3,0,counta($a:$a),1)
to check what is shown use f5gototype in the name. Adjust as needed

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"MJKelly" wrote in message
...
On May 11, 7:43 pm, "Don Guillett" wrote:
Sounds like a candidate for defined name ranges using offset
insertnamedefinename it colA or whatever.
In the refers to box
=offset($a$1,0,0,counta($a:$a),1)
in the source of the chart type in =yourworkbookname.xls!cola
Now when you add or delete from col a the range will self adjust

to add col B tied to col A length
=offset(cola,1)
etc

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"MJKelly" wrote in
message

...

Hi,


I want to be able to plot data on a radar chart, however, the number
of points varies from around 5 to 15. How can I use VBA code to reset
the source data? The source data is in a column, and I want to use
the first row to the last row (it's the last row that changes
according to the amount of data I need to chart).


Basically, I need to know how to adjust the source range using VBA?
The size of the range would be the same for the three series I plot on
the radar chart.


Hope you can help?


Thanks,
Matt


Don,

When I try this I end up with a range which is three cells longer than
required. I only need the range to be as long as the column of data
(the data is continuous).
Can the source range be changed using VBA? I need to change the
source of three series of data for the same chart (all ranges will be
the same size, just in different columns).
Regards,
Matt

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
Bar width on existing chart changes when changing source data Robert Brown Charts and Charting in Excel 5 April 30th 10 07:18 PM
Chart changing based on change in data source (number of rows/colu Bal Ram Bhui, Jakarta Charts and Charting in Excel 1 November 16th 08 06:02 AM
Source Range Data changing based on drop-down menu [email protected] Charts and Charting in Excel 3 March 9th 08 06:19 PM
Line disappearing from chart after changing data source Albert Charts and Charting in Excel 0 July 12th 06 12:17 PM
Changing a chart source data in code. JimPNicholls Excel Programming 1 May 7th 04 03:57 PM


All times are GMT +1. The time now is 03:19 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"