Dynamic Chart Range

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,347
Office Version
  1. 365
Platform
  1. Windows
I have been searching the net and reading a book to try and make a simply chart I have Dynamic using VBA.

I am trying to make it so that the chart changes if you add more data? For example if you start with 10 entries and then add another 5, I want the chart to reflect this.

I need it to adjust the number of columns in the chart. Sometimes the data in rows 103 and 104 go out to column F or sometimes it only goes to column D or it could be 10 months worth of data in the two rows and go out to column L

My chart is Chart 4 on a tab named Cash Flow

The current range of the chart is ='Cash Flow'!$B$101:$L$104
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
I have been searching the net and reading a book to try and make a simply chart I have Dynamic using VBA.

I am trying to make it so that the chart changes if you add more data? For example if you start with 10 entries and then add another 5, I want the chart to reflect this.

I need it to adjust the number of columns in the chart. Sometimes the data in rows 103 and 104 go out to column F or sometimes it only goes to column D or it could be 10 months worth of data in the two rows and go out to column L

My chart is Chart 4 on a tab named Cash Flow

The current range of the chart is ='Cash Flow'!$B$101:$L$104

Formulas > Name Manger > New

Name: DynamicChart
Refers to : =offset(Cashflow!$A$1,0,0,counta(A:A),count(1:1))

This basically counts how many rows there are and how many columns there are giving you a dynamic chart range:

So when making your chart just enter "Dynamic Chart" in the range field and it should pull up all the required data
 
Upvote 0

Forum statistics

Threads
1,224,613
Messages
6,179,896
Members
452,948
Latest member
Dupuhini

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