ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   Fill screen with chartobject by zooming? (https://www.excelbanter.com/charts-charting-excel/152-fill-screen-chartobject-zooming.html)

Gunnar Johansson

Fill screen with chartobject by zooming?
 
Hi,

I have chartobjects in a worksheet and try to make code with commandbar
buttons to jump to different chartobjects and zoom in the chartobject to
fill the whole screen. Surley this can be done?

The command button code is not a problem, it is the zoom 'n fill part that
bother me...You have to consider different screens, resolutions etc. give
different size, I guess.

I'm unexperienced of coding zooming and hope you can give me hints or more
to solve this.

/Thank you in advance




Jon Peltier

Gunnar -

This macro will zoom an embedded chart to fill the screen.

'-----
Sub ZoomChart(cht As Chart)
Dim rZoom As Range

With cht.Parent
Set rZoom = ActiveSheet.Range(.TopLeftCell, .BottomRightCell)
End With

rZoom.Select

ActiveWindow.Zoom = True
End Sub
'-----

Run the code like this:

ZoomChart ActiveChart

or

ZoomChart oChartObject.Chart


- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

Gunnar Johansson wrote:

Hi,

I have chartobjects in a worksheet and try to make code with commandbar
buttons to jump to different chartobjects and zoom in the chartobject to
fill the whole screen. Surley this can be done?

The command button code is not a problem, it is the zoom 'n fill part that
bother me...You have to consider different screens, resolutions etc. give
different size, I guess.

I'm unexperienced of coding zooming and hope you can give me hints or more
to solve this.

/Thank you in advance






All times are GMT +1. The time now is 07:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com