Magnify A Section Of Your Screen


June 30, 2021 - by

Magnify A Section Of Your Screen

Challenge: You would like to display 48 months of data across your monitor. When you zoom down to 40%, you can see all the columns, but you cannot make out any numbers on the screen.

Solution: You can use a cool utility written by Ivan F. Moala and Jaafar Tribak and posted at the MrExcel message board. Jaafar started out with a modal user form that would display a magnification of the screen underneath the cursor. Ivan jumped in with improvements to allow the user form to be modeless and to update as you scroll around the worksheet.

The code is shown at the message board and in both Ivan’s and Jaafar’s versions of the program. They make use of a Windows API to return a stretched version of the screen underneath the cursor.


As you can see in Figure 154, as you move around the screen, an enlarged version of the area around the cell pointer is shown in the form.

Figure 154. As you move the mouse around the screen, the user form shows a magnified picture of the area under the cursor.
Figure 154. As you move the mouse around the screen, the user form shows a magnified picture of the area under the cursor.

If you move the cursor close to the magnifier, a magnified version of the magnifier appears in the form. In Figure 155, the magnifier appears three times.

Figure 155. The magnifier even magnifies itself!
Figure 155. The magnifier even magnifies itself!

Breaking It Down: The user form runs a macro called GetMagnifiedImageUnderCursor. This macro loops continuously. To stop the macrofrom running, a UserForm_DblClickproceduresetsthevalueofaglobal variable to TRUE. When the loop inside GetMagnifiedImageUnderCursor sees that this variable is set to TRUE, the loop is allowed to end.



Note: The accessibility options in Windows provide a magnifier. It is not as cool as this one, though.

Summary: You can use a utility to magnify a section of an Excel document.

Source: Cool Excel Magnifying Glass to Zoom the entire Screen ! on the MrExcel Message Board.

The post was nominated by Greg Truby. Thanks to Ivan F Moala and Jaafar Tribak for collaborating on the code in this topic.

Title Photo: Kevin Ku on Unsplash


This article is an excerpt from Excel Gurus Gone Wild.