Zoom to a chart

eawachte

New Member
Joined
Jan 14, 2011
Messages
29
I am trying to make a "plotter" that will zoom to a selected chart with a macro button. I have tried a couple things but nothing seems to work. I can select the chart but not zoom to show the chart.

What line of code will actually zoom to the chart once i have selected it?

Thanks!
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
I am trying to make a "plotter" that will zoom to a selected chart with a macro button. I have tried a couple things but nothing seems to work. I can select the chart but not zoom to show the chart.

What line of code will actually zoom to the chart once i have selected it?

Thanks!
Try this:
Code:
Sub ZoomToChart()
Dim cht As ChartObject
Set cht = ActiveSheet.ChartObjects("Chart 1") 'Change name to suit
cht.Select
ActiveWindow.ScrollColumn = cht.TopLeftCell.Column
ActiveWindow.ScrollRow = cht.TopLeftCell.Row
ActiveWindow.Zoom = 125
End Sub
 
Upvote 0
Hi

This is an example of how to zoom to a chart:

Code:
Sub ZoomToChart()
 
Application.Goto ActiveSheet.ChartObjects("Chart 1").TopLeftCell, True
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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