Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Peter Rooney
 
Posts: n/a
Default Altering the range that is plotted by a chart via VBA

Good morning all.

I haven't really done a huge amount on charting, so I'm sure you'll think
that these questions are a bit simplistic, but here goes!

I plot a chart from a worksheet that contains three columns of data - the X
axis contains week numbers, and is in B29:B54. Actual hours are entered in
F29:F24 and cumualtive hours in G29:G24. The cumulative formula is of the
form: =SUM($F$29:F29)

So, each week, in order to plot another week's data, I have to copy this
cumulative formula down by one cell, which, considering I have a lot of these
reports, is a bit time consuming.

If I replace my cumulative formula with something that displays a zero or a
label if there is no corresponding weekly actual, the cumulative chart line
plummets down to zero, which makes the charts look unprofessional. If I
replace it with something that picks up the previous week's cumulative value
if there is no corresponding weekly actual, the cumulative chart line goes
across at a value equal to the latest cumulative, which also doesn't look too
good.

So, the question is, how, in this week for example, can I have my chart area
as b29:B54 (x-axis);f29:f54 (actuals); g29:f40 (cumulatives), but next week
extend
my cumulative plot to g29:f41 (i.e. extend it down by one week)?

Eventiually, I'd like to etend this idea to plotting a rolling 12 week
chart, so to start, it would plot b29:B38 (x-axis);f29:f38 (actuals); g29:f38
(cumulatives) then the next week, b30:B39 (x-axis);f30:f39 (actuals); g30:f39
(cumulatives) and so on, but one thing at a time.

If anyone has any good pointers as to how I might achieve some or all of the
above, I'd be extremely grateful.

Regards & thanks in advance.

Pete




  #2   Report Post  
Tushar Mehta
 
Posts: n/a
Default Altering the range that is plotted by a chart via VBA

Adapt the various ideas at
Dynamic Charts
http://www.tushar-mehta.com/excel/ne...rts/index.html

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Multi-disciplinary business expertise
+ Technology skills
= Optimal solution to your business problem
Recipient Microsoft MVP award 2000-2005

In article ,
says...
Good morning all.

I haven't really done a huge amount on charting, so I'm sure you'll think
that these questions are a bit simplistic, but here goes!

I plot a chart from a worksheet that contains three columns of data - the X
axis contains week numbers, and is in B29:B54. Actual hours are entered in
F29:F24 and cumualtive hours in G29:G24. The cumulative formula is of the
form: =SUM($F$29:F29)

So, each week, in order to plot another week's data, I have to copy this
cumulative formula down by one cell, which, considering I have a lot of these
reports, is a bit time consuming.

If I replace my cumulative formula with something that displays a zero or a
label if there is no corresponding weekly actual, the cumulative chart line
plummets down to zero, which makes the charts look unprofessional. If I
replace it with something that picks up the previous week's cumulative value
if there is no corresponding weekly actual, the cumulative chart line goes
across at a value equal to the latest cumulative, which also doesn't look too
good.

So, the question is, how, in this week for example, can I have my chart area
as b29:B54 (x-axis);f29:f54 (actuals); g29:f40 (cumulatives), but next week
extend
my cumulative plot to g29:f41 (i.e. extend it down by one week)?

Eventiually, I'd like to etend this idea to plotting a rolling 12 week
chart, so to start, it would plot b29:B38 (x-axis);f29:f38 (actuals); g29:f38
(cumulatives) then the next week, b30:B39 (x-axis);f30:f39 (actuals); g30:f39
(cumulatives) and so on, but one thing at a time.

If anyone has any good pointers as to how I might achieve some or all of the
above, I'd be extremely grateful.

Regards & thanks in advance.

Pete





  #3   Report Post  
tubbinator
 
Posts: n/a
Default Altering the range that is plotted by a chart via VBA


Got a reply off of the Excel-L mailing list. Had to move the
".ChartType = xlLine" line up higher. Moved it to right after chart
creation. I could have sworn I'd gotten errors with that line up
higher before. Oh well.

Tubbs


--
tubbinator
------------------------------------------------------------------------
tubbinator's Profile: http://www.excelforum.com/member.php...o&userid=28239
View this thread: http://www.excelforum.com/showthread...hreadid=477811

  #4   Report Post  
Jon Peltier
 
Posts: n/a
Default Altering the range that is plotted by a chart via VBA

You replied to the wrong thread.

Sometimes putting .ChartType up too high will cause an error. If you specify a
bubble of stock chart type before specifying enough data to populate that chart
type, it will crash.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

tubbinator wrote:

Got a reply off of the Excel-L mailing list. Had to move the
".ChartType = xlLine" line up higher. Moved it to right after chart
creation. I could have sworn I'd gotten errors with that line up
higher before. Oh well.

Tubbs



  #5   Report Post  
Peter Rooney
 
Posts: n/a
Default Altering the range that is plotted by a chart via VBA

Thanks to all who replied.
I eventually achieved what I wanted by plotting the chart against named
ranges, and using VBA to redefine the ranges to which those named applied.
The charts automtically updated based on the redefined ranges.
I shouldn't have been so lazy!

Regards & have a good weekend.

Pete



"Peter Rooney" wrote:

Good morning all.

I haven't really done a huge amount on charting, so I'm sure you'll think
that these questions are a bit simplistic, but here goes!

I plot a chart from a worksheet that contains three columns of data - the X
axis contains week numbers, and is in B29:B54. Actual hours are entered in
F29:F24 and cumualtive hours in G29:G24. The cumulative formula is of the
form: =SUM($F$29:F29)

So, each week, in order to plot another week's data, I have to copy this
cumulative formula down by one cell, which, considering I have a lot of these
reports, is a bit time consuming.

If I replace my cumulative formula with something that displays a zero or a
label if there is no corresponding weekly actual, the cumulative chart line
plummets down to zero, which makes the charts look unprofessional. If I
replace it with something that picks up the previous week's cumulative value
if there is no corresponding weekly actual, the cumulative chart line goes
across at a value equal to the latest cumulative, which also doesn't look too
good.

So, the question is, how, in this week for example, can I have my chart area
as b29:B54 (x-axis);f29:f54 (actuals); g29:f40 (cumulatives), but next week
extend
my cumulative plot to g29:f41 (i.e. extend it down by one week)?

Eventiually, I'd like to etend this idea to plotting a rolling 12 week
chart, so to start, it would plot b29:B38 (x-axis);f29:f38 (actuals); g29:f38
(cumulatives) then the next week, b30:B39 (x-axis);f30:f39 (actuals); g30:f39
(cumulatives) and so on, but one thing at a time.

If anyone has any good pointers as to how I might achieve some or all of the
above, I'd be extremely grateful.

Regards & thanks in advance.

Pete






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
Charting data points and show a target range on the same chart. Minireefkeeper Charts and Charting in Excel 6 February 18th 06 06:50 PM
Macro to change Chart Range when inserting a column Mark Charts and Charting in Excel 1 September 13th 05 01:12 PM
How do I automatically update a chart range in Excel Quinton Excel Discussion (Misc queries) 1 July 27th 05 12:57 PM
Chart with a plotted point inside an envelope. fewest Charts and Charting in Excel 2 July 23rd 05 04:39 PM
dynamic range for excel chart bobf Excel Discussion (Misc queries) 1 January 26th 05 11:07 AM


All times are GMT +1. The time now is 06:26 PM.

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

About Us

"It's about Microsoft Excel"