VBA-Code-Snippets-Thumb

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

Color Picker VBA thumb

Calling and using the color picker with VBA

When building Excel-based tools and applications it is often useful for the user to select a color.  Whilst it is possible to build a custom UserForm, Excel’s native Color window is more than suitable for most circumstances. Excel’s native color picker: To show the Color window, you might think we could use the Macro Recorder, but Read More

VBA-Code-Snippets-Thumb

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