Dynamic Chart Range

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,332
Office Version
  1. 365
Platform
  1. Windows
Is there a way to "Name" a chart range like you can Name a Range in a Tab? I am trying to make a Dynamic chart so that I can define the chart range in VBA. My problem is that I alwsy have to create a chart for proposals I do. Unfortionatley, the date range of the chart is always different depending on the period of performance (AKA Number of Months). I know how to dynamically name a Range in VBA. So "Naming" Ranges is not my hurdle. I need to know if there is a way to use that Named range to create a chart vs resetting the range for each proposal I do.

Any chart experts out there???

Thanks for the help!
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Hi,

I'm not sure I follow...

Are you using the same chart design, but just want it to refer to different data based on what you want to look at at the time?

Whenever I do this, I use a dynamic named ranges and point my chart to these named ranges.

Is this what you're after? If so, I will explain how this can be done.

Matty
 
Upvote 0
Sorry for not responding sooner, pulled into a meeting.

Almost exactly.

I have a template for proposal work. I have the spreadsheet that has the chart already setup with formulas that pull in data from a database. I will select the proposal number from the database and it loads the data and period of performance (Start Month through End month, base on some VBA Code.

Somtimes the data that is pulled in is 8 months others might be 24 or .....So basically I have month across row two. The VBA deletes any of the months that exceed the end month (Which I tell it which is the end month using VBA and the date I enter)

So ech time I use this template my number of months across row 2 varies. Hence my problem. I have to doubld click the chart and adjust the range. Is there was a way for me to name the range, using code to determine how many rows I have?

Hope that helps, sound like you probably know.
 
Upvote 0
Help!

Almost exactly.

I have a template for proposal work. I have the spreadsheet that has the chart already setup with formulas that pull in data from a database. I will select the proposal number from the database and it loads the data and period of performance (Start Month through End month, base on some VBA Code.

Somtimes the data that is pulled in is 8 months others might be 24 or .....So basically I have month across row two. The VBA deletes any of the months that exceed the end month (Which I tell it which is the end month using VBA and the date I enter)

So ech time I use this template my number of months across row 2 varies. Hence my problem. I have to doubld click the chart and adjust the range. Is there was a way for me to name the range, using code to determine how many rows I have?

Hope that helps, sound like you probably know.[/QUOTE]
 
Upvote 0
You are on the right track. Create a named formula that maps to the current range to plot. Then, use that name in the chart.

See
Dynamic Charts
http://www.tushar-mehta.com/excel/newsgroups/dynamic_charts/index.html

Is there a way to "Name" a chart range like you can Name a Range in a Tab? I am trying to make a Dynamic chart so that I can define the chart range in VBA. My problem is that I alwsy have to create a chart for proposals I do. Unfortionatley, the date range of the chart is always different depending on the period of performance (AKA Number of Months). I know how to dynamically name a Range in VBA. So "Naming" Ranges is not my hurdle. I need to know if there is a way to use that Named range to create a chart vs resetting the range for each proposal I do.

Any chart experts out there???

Thanks for the help!
 
Upvote 0

Forum statistics

Threads
1,213,521
Messages
6,114,104
Members
448,548
Latest member
harryls

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top