VBA-Code-Snippets-Thumb

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

Change image based on cell value Thumb

3 ways to change an image based on a cell value

From stock parts to holiday villas, from employees to logos, there are many reasons you may want to automatically change an image based on a cell value.  In this post, we’ll explore 3 different methods to achieve this task: Named range + INDEX/MATCH + linked picture Chart fill + #N/A VBA User-Defined Function Each solution Read More

VBA-Code-Snippets-Thumb

VBA Code to Password Protect an Excel file

Password protecting an Excel file achieves two main objectives (1) prevents unauthorized access to the Excel file (2) prevents unauthorized modification of the Excel file. File-level protection is not the same as worksheet protection or workbook protection.  Worksheet protection controls what a user can or cannot do on a worksheet, such as inserting rows or Read More

VBA-Code-Snippets-Thumb

VBA code to Protect and Unprotect Workbooks

In a previous VBA Code Snippet, we covered protecting and unprotecting worksheets.  In this post, we will consider protecting and unprotecting workbooks.  The two topics are closely related, so if this post does not provide the information you need, then read that post too. Before getting started, there is an important change in Excel 2013 Read More

VBA-Code-Snippets-Thumb

VBA code to Protect and Unprotect Worksheets

Protecting and unprotecting worksheets is a common action.  There is nothing worse than somebody who doesn’t know what they’re doing over typing important formulas and cell values.  Many advancing VBA programmers will start to consider how to apply worksheet protection automatically with Macros.  The VBA Code Snippets below show how to do most activities related Read More