When you become more advanced with macros and VBA programming (Visual Basic for Applications), you realise that you can create re-useable macros.
In Excel if you need to hide data or workings sheets you can hide multiple sheets in one action. Unfortunately Excel won’t let you unhide multiple sheets in one step (even in the latest version). To get around this limitation you can use a macro that unhides all the sheets.
If you need to limit where a user can scroll to in a sheet you can change a setting in the VBA screen to restrict access to a specific range.
When you first start out using VBA and writing VBA (macro) code it is useful that the VBA Editor helps you quickly identify when you have made a mistake. If a line of code has an error it will display a dialog box that explains the error and turns the line of code red.
Hyperlinks are a great tool as they allow you to speed up and simplify navigation within a file. Sometimes hyperlinks can be frustrating. See how to remove some of those frustrations below.
There are two commands you can insert at the top of your code to speed up your macros.
When you are using sheet passwords in Excel it can be handy to have a macro to unprotect all the sheets in one step. This can make maintenance easier.
The more you use macros the more important they become and the more you want to make sure the VBA* code doesn’t get changed by someone who shouldn’t change it. You may also want to stop people viewing your code.
The ability to drag and drop in Excel is great when you know what you are doing. The downside is that it is also easy for inexperienced users to affect the structure of your spreadsheet by using drag and drop techniques.
Macros can really improve your productivity in Excel. When you record a macro you have the option to define a shortcut key. Did you know you can also define a shortcut key for non-recorded macros?
Pivot Tables are incredibly powerful and easy to use. Unfortunately their headings can include the terms “Sum of” or “Count of”. This is not always what you’d like to present to users. A macro to the rescue.
If I print emails I typically only want the first page. To do that in Outlook takes a few clicks each time.
Word has a keyboard shortcut to convert lowercase to uppercase. Shift + F3. Excel doesn’t. Macros to the rescue again.
If you need to hide certain sheets every time an Excel file is opened then a macro may be your solution. Maybe the sheets are working sheets and don’t need to be visible to the user.
If you need to print certain sheets in a file in one step you can set up a macro to do it automatically and flexibly.
If you have a number of linked Excel files and you make a structural change (insert rows or columns) you need to save all the open files to ensure that the links are updated and retained. This can be tedious as there is no Save All option in Excel. Word has a Save All option, but not Excel.
I get many questions from Australian CPA’s and sometimes the solution involves a macro. Not everyone knows how to install and run a macro. This post will take you through the basics.
Excel’s Go To feature provides a quick way to select certain types of cells. For example, if you wanted to apply the same fill colour to all formula cells on a sheet, you can do that in five easy steps using Go To.
Here is an example of a simple macro that solves a problem in Excel 2003 and earlier versions.
Range names can be corrupted if a cell that they refer to gets deleted. This doesn’t mean that the cell value gets deleted, but the cell itself is removed from the sheet.
Pivot Tables changed in Excel 2007 and 2010. The default setting doesn’t let you drag and drop the field names on the Pivot Table itself. You could do that in Excel 2003 and you can still do it in the newer versions. All you need to do is change a setting.