PC Review


Reply
Thread Tools Rate Thread

changing the source range of a chart

 
 
MJKelly
Guest
Posts: n/a
 
      11th May 2009
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
 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      11th May 2009
Sounds like a candidate for defined name ranges using offset
insert>name>define>name 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
(E-Mail Removed)
"MJKelly" <(E-Mail Removed)> wrote in message
news:59e4a8c8-913d-46e6-9b8f-(E-Mail Removed)...
> 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


 
Reply With Quote
 
MJKelly
Guest
Posts: n/a
 
      11th May 2009
On May 11, 7:43*pm, "Don Guillett" <dguille...@austin.rr.com> wrote:
> Sounds like a candidate for *defined name ranges using offset
> insert>name>define>name 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
> dguille...@austin.rr.com"MJKelly" <matt.j.ke...@gmail.com> wrote in message
>
> news:59e4a8c8-913d-46e6-9b8f-(E-Mail Removed)...
>
> > 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 With Quote
 
Don Guillett
Guest
Posts: n/a
 
      12th May 2009
>>=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 f5>goto>type in the name. Adjust as needed

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"MJKelly" <(E-Mail Removed)> wrote in message
news:cba64ab9-d6f6-4fe6-bf61-(E-Mail Removed)...
On May 11, 7:43 pm, "Don Guillett" <dguille...@austin.rr.com> wrote:
> Sounds like a candidate for defined name ranges using offset
> insert>name>define>name 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
> dguille...@austin.rr.com"MJKelly" <matt.j.ke...@gmail.com> wrote in
> message
>
> news:59e4a8c8-913d-46e6-9b8f-(E-Mail Removed)...
>
> > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get source range from chart object? guest Microsoft Excel Programming 1 17th Jul 2008 08:16 PM
chart with changing data source interactive chart Feketik Microsoft Excel Charting 2 19th Mar 2004 09:26 AM
chart with changing data source interactive chart Feketik Microsoft Excel Charting 0 18th Mar 2004 04:34 PM
Chart Source Data Ranges Changing when Data Sheet updated from text file source. Tekn0 Microsoft Excel Charting 3 8th Jan 2004 04:45 PM
Excel closes when changing chart data source range Josh Microsoft Excel Crashes 1 24th Oct 2003 04:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:22 AM.