Zoom Microsoft Excel Cell with Macro
When we’re demonstrating our report to our client or boss maybe sometime we need to focus on a cell in Microsoft Excel project. And as we know Microsoft Excel doesn’t give the builtin function to zoom only a cell.
So I will share to make it with Macro.
OK, Microsoft Excel can give us flexibility to make our own tool with Macro, just follow these steps to make it.
- Open Microsoft Excel, you may open it by click Start -> All Programs -> Microsoft Excel or click Start -> Run menu then type
excelin textbox then press Enter key.

- To make a macro, click Tools -> Macro -> Visual Basic Editor menu.

- After Visual Basic Editor is open, make a module with click Insert -> Module menu.

- Then type this code in its workspace:
Sub ZoomIt() Dim my_range As Range Dim zoom_in As Single Set my_range = Selection zoom_in = 5 For Each p In ActiveSheet.Pictures If p.Name = "ZoomIt" Then p.Delete Exit For End If Next my_range.CopyPicture appearance:=xlScreen, Format:=xlPicture ActiveSheet.Pictures.Paste.Select With Selection .Name = "ZoomIt" With .ShapeRange .ScaleWidth zoom_in, msoFalse, msoScaleFromTopLeft .ScaleHeight zoom_in, msoFalse, msoScaleFromTopLeft With .Fill .ForeColor.SchemeColor = 9 .Visible = msoTrue .Solid End With End With End With my_range.Select Set my_range = Nothing End Sub
- Recheck the code and if make sure that the code is right (you may copy then paste the code from above and if you’re ensuring it right click Debug -> Compile VBA Project menu.

- Close the Visual Basic Editor window.
- Right click on empty space in Microsoft Excel toolbar area then click Customize menu.

- Click Commands tab and click Macros category then click Custom Button commands.

- Drag it to toolbar that you want (I choose to put it beside Help icon).

- And if you’re doing it right you can see a new icon on toolbar.

- Then assign the macro with right click the icon and click Assign Macro menu.

- Choose ZoomIt Macro in list then click OK button.

- To make it more user friendly, right click the icon and change its name and view it in Image & Text mode.

- And look the icon looking now.

- Now, try to type some data in cell.

- Try to move cursor on a cell then click the macro icon on toolbar.

- Here is the result.

- To close the zoomed cell just click the zoomed cell then press Delete key.

(article no: 0099)
![Otak Atik [dot] Com](http://www.otakatik.com/wp-content/themes/typebased/styles/default/logo.jpg)


Recent Comments