Shazam
04-07-2006, 12:27 PM
I need some help. I'm trying to do a dynamic range in a source box in a chart. I have a simple macro recording to create 3 charts every morning.
Is there a code that it will dynamically select a range from cell F20 to the last active cell in that column for the values box of the chart and select a range from cell G20 to the last active cell of that column for the Category Label box? I know there is a named ranges solution but it wouldn’t work out in my situation, long story.
Here is a macro I recorded. Can it be modified to do that?
Sheets("1st Shift").Select
ActiveSheet.ChartObjects("Chart 37").Activate
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection(1).XValues = "=Table!R20C7:R21C7" 'F20:f Vaules:
ActiveChart.SeriesCollection(1).Values = "=Table!R20C6:R21C6" 'G20:g Category Labels:
ActiveWindow.Visible = False
Windows("Copy of MS Performance Chartss.xls").Activate
Is there a code that it will dynamically select a range from cell F20 to the last active cell in that column for the values box of the chart and select a range from cell G20 to the last active cell of that column for the Category Label box? I know there is a named ranges solution but it wouldn’t work out in my situation, long story.
Here is a macro I recorded. Can it be modified to do that?
Sheets("1st Shift").Select
ActiveSheet.ChartObjects("Chart 37").Activate
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection(1).XValues = "=Table!R20C7:R21C7" 'F20:f Vaules:
ActiveChart.SeriesCollection(1).Values = "=Table!R20C6:R21C6" 'G20:g Category Labels:
ActiveWindow.Visible = False
Windows("Copy of MS Performance Chartss.xls").Activate