VBA code to contol Form Control checkboxes

Checkboxes are one of the easiest ways to create interaction with users.  Controlling them with VBA makes them more flexible and more useful in Excel applications. Here is a collection of the most common code snippets and settings.   Create Check Boxes The following code will create a checkbox Sub CreateCheckBoxes() ‘Create variable Dim chkBox Read More

Run a macro from a macro (from another workbook)

In VBA, there are several ways to run a macro within a macro, and even run a macro from another workbook.  On forums these methods are used interchangeably, which can lead to confusion for others, as depending on the method for running/calling the macro, the syntax is slightly different. This post shows these common methods Read More

VBA Code to control Excel’s Zoom settings

Excel has zoom settings for worksheets, UserForms and print settings.  Each of these serves different purposes and used at different points, but they can all be controlled by VBA.   Worksheet zoom settings The worksheet zoom setting in Excel will always be an integer.  If the value set by VBA contains decimal places it will Read More

VBA: Convert centimeters, inches & pixels to points

It is frustrating that Excel, PowerPoint and Word work natively using a measurement known as points.  However, measurements within the standard application menus are set in centimeters or inches.  This can be seen when setting the position and size of a shape in PowerPoint through the standard menus. Yet, when using a macro to retrieve Read More