Getting Chart DataRange

AccessShell

Board Regular
Joined
Sep 5, 2015
Messages
50
Office Version
  1. 2003 or older
Platform
  1. Windows
I created a line chart based on data from another tab in the spreadsheet. I ran 'Record New Macro' from the tools tab tp get code to expand the DataRange.
That was fairly simple.
But, what I need is to get the value of the DataRange already in the chart. I want to change the datarange from code. The last point on the graph is usually well before the datarange for the chart.
I need to compare the datarange in the chart with the last point in the chart to decide if I need to (in code) expand the datarange.

I can easily convert Excel VBA to VB6

I hope this is clear.

NOTE: This was posted, with different wording, in another forum.

Thanks
 
JP. I very slightly modified your VBA code and successfully replaced the row number (originally is was 1102) with a new number 1200. The update worked correctly. Now I have to convert the VBA code to VB6.

Thanks
 
Upvote 0

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Forum statistics

Threads
1,215,756
Messages
6,126,686
Members
449,329
Latest member
tommyarra

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