Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
PaulW
 
Posts: n/a
Default Automatically Resizing a Graph

A Hlookup from another sheet provides the data, and displays it on a graph.
The dates used for the Hlookup are provided by a user, these dates can be
anywhere from 1 week to 6 months apart.
The Graph as it is mostly blank at the moment when set to 2 weeks as it
shows the other 5 and a half months as blank. I thought a Macro might sort
the problem for me, so on the Options tab there is a button that runs the
macro, I had hoped that I could use my limited (very limited!) knowledge of
VBA to change a recorded macro.
To that end, on the Data sheet in cell B99 is a =concatenate that currently
reads =B101:K101 the K part dependant on how much data is present.
I recorded a macro where I changed the graphs "Category (X) axis labels:" to
=B101:K101 when I opened the macro it looked alot like
Sub Resize_Chart()
ActiveSheet.ChartObjects("Chart 28").Activate
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection(1).XValues = "=Data!R101C2:R101C11"
ActiveChart.SeriesCollection(2).XValues = "=Data!R101C2:R101C11"
ActiveChart.SeriesCollection(3).XValues = "=Data!R101C2:R101C11"
ActiveChart.SeriesCollection(4).XValues = "=Data!R101C2:R101C11"
ActiveChart.SeriesCollection(5).XValues = "=Data!R101C2:R101C11"
ActiveChart.SeriesCollection(6).XValues = "=Data!R101C2:R101C11"
ActiveChart.SeriesCollection(7).XValues = "=Data!R101C2:R101C11"
End Sub

And I have no idea how to change this to use the range in Cell B99 on the
Data sheet... any idea's?
  #2   Report Post  
Posted to microsoft.public.excel.misc
PaulW
 
Posts: n/a
Default Automatically Resizing a Graph

Nevermind, once I figured out what the whole R101C2:R101C11 ment I changed
the concatenate to be similar and a inset worked :p

"PaulW" wrote:

A Hlookup from another sheet provides the data, and displays it on a graph.
The dates used for the Hlookup are provided by a user, these dates can be
anywhere from 1 week to 6 months apart.
The Graph as it is mostly blank at the moment when set to 2 weeks as it
shows the other 5 and a half months as blank. I thought a Macro might sort
the problem for me, so on the Options tab there is a button that runs the
macro, I had hoped that I could use my limited (very limited!) knowledge of
VBA to change a recorded macro.
To that end, on the Data sheet in cell B99 is a =concatenate that currently
reads =B101:K101 the K part dependant on how much data is present.
I recorded a macro where I changed the graphs "Category (X) axis labels:" to
=B101:K101 when I opened the macro it looked alot like
Sub Resize_Chart()
ActiveSheet.ChartObjects("Chart 28").Activate
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection(1).XValues = "=Data!R101C2:R101C11"
ActiveChart.SeriesCollection(2).XValues = "=Data!R101C2:R101C11"
ActiveChart.SeriesCollection(3).XValues = "=Data!R101C2:R101C11"
ActiveChart.SeriesCollection(4).XValues = "=Data!R101C2:R101C11"
ActiveChart.SeriesCollection(5).XValues = "=Data!R101C2:R101C11"
ActiveChart.SeriesCollection(6).XValues = "=Data!R101C2:R101C11"
ActiveChart.SeriesCollection(7).XValues = "=Data!R101C2:R101C11"
End Sub

And I have no idea how to change this to use the range in Cell B99 on the
Data sheet... any idea's?

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
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
Automatically changing the range in a graph Bret Davis Charts and Charting in Excel 1 January 14th 06 07:13 PM
Hyperlinkage of one graph with another graph or Drill down graph Sanjay Kumar Singh Charts and Charting in Excel 1 January 3rd 06 12:22 PM
Graph colors automatically change PuckMark Charts and Charting in Excel 1 October 21st 05 09:46 AM
How do I automatically update a graph after adding a data point Beertje Charts and Charting in Excel 2 October 10th 05 11:32 AM


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