‘Zoom to selection’ with VBA to improve presentation of Excel financial models

Blog

Blog

Blog

Blog

all posts

tags

‘Zoom to selection’ with VBA to improve presentation of Excel financial models

by Rickard Warnelid on June 1 2009

It is not always easy to ensure that a financial model presents well on all screen types and resolution settings. I notice frequently while working on spreadsheets on four different platforms

  • Office desktop (3 x 19 inch screens)
  • Laptop 13.3 inch laptop
  • Blackberry (2 inch screen)
  • Home desktop (24 inch widescreen)

There is not one simple way of making sure that your financial model looks great on all platforms but one trick that often helps is the ‘zoom to selection’ functionality. This Excel functionality gives the user the possibility to zoom in on a selected range to fill the screen which is quite useful for disclaimers and cover sheets of financial models. Clearly not even this trick can improve the presentation on the blackberry, but I am sure you can live with that.

Manual ‘Zoom to Selection’ in Excel

To understand the functionality, select a range in Excel (say A1:N44) and then click ‘Selection’ in the Zoom-menu.

Zoom to selection in Excel - dropdown

Zoom to selection in Excel - dropdown

Excel will then set the zoom-level to whatever is necessary to make the specified range fill the screen.

Automated ‘Zoom to Selection’ using VBA in Excel

The manual Zoom to Selection has limited value as it will only set the zoom level to be right just for your computer and since your clients and colleagues may have different settings they would have to redo it.

By using VBA code this process can be automated and it is quite simple.

Sub ZoomToSelectionDemo()

'Select the range you want to zoom to
Range("A1:N44").Select

'Zoom to the selected range
ActiveWindow.Zoom = True

'Select range A1
Range("A1").Select
End Sub
VBA code for zoom to selection

VBA code for zoom to selection

To see a working example of this, feel free to download one of our Excel Tutorials and have a look at the VBA code in the Disclaimer section.

COMMENTS

Post new comment

The content of this field is kept private and will not be shown publicly.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.

Need a financial model audit?

Need a financial model audit?

Do you want to find our more about our financial model audit services??

Read more about Corality

Upcoming Courses

Best Practice Project Finance Modelling
Sydney
30 May - 31 May 2012
Best Practice Project Finance Modelling
London
11 June - 12 June 2012
Advanced Project Finance Modelling
London
13 June - 14 June 2012

Bloggers

Laura Dean

Laura Dean

Laura is our creative and motivated Marketing Coordinator.

Rickard Warnelid

Rickard Warnelid

Rickard Warnelid is the Managing Director of Corality Financial Group.

Peter Weatherston

Peter Weatherston

Peter is a UK qualified accountant with 10+ years experience in financial modelling and financial model auditing.

Bing Chien Quek

Bing Chien Quek

Bing is Corality's in-house VBA expert. He has worked on numerous projects as well as facilitated VBA training courses internationally.

Caroline Wiroth

Caroline Wiroth

Caroline has over 8 years of experience in marketing and Public Relations.

Tim Heng

Tim Heng

Tim has a wide range of experience in analytics and modelling across a number of different industry sectors (corporate banking, vehicle finance, credit risk and marketing analytics).

Blake McNaughton

Blake McNaughton

Blake McNaughton is an Associate based in Corality’s Head Office in Sydney, Australia.

Haydn Palliser

Haydn Palliser

Haydn is an Associate at Corality with a wealth of experience in structured finance, consulting and is a chartered professional engineer.

Cathryn Fish

Cathryn Fish

Cathryn is our energetic and super organised Training Experience Manager.

Nick Crawley

Nick Crawley

Nick Crawley is the Chairman and Head of Consulting of Corality Financial Group.

Grace Utama

Grace Utama

Grace Utama is a financial modelling expert, with particular expertise in advanced Excel techniques and VBA Macros.

Have a question or comment? We would love to hear from you. More contact options

We respect your email privacy.

Sitemap | Terms | Privacy © Copyright 2012 Corality Financial Group