0:00
Hello everyone. In today's video, I'm going to show you a simple VBA macro that helps you find
0:05
and select all cells containing formulas in your ActiveXL worksheet. This can be particularly
0:10
useful when you want to quickly review or audit all formulas in a spreadsheet. Let's dive into
0:15
the code and see how it works. Press Alt F11 to open the code editor and insert a module
0:20
Here's the full VBA code. Create a subroutine named Select Formula Cells
0:25
Declares a variable formula cells to hold the range of cells that contain formulas
0:30
Tells VBA to continue running even if an error occurs, preventing the macro from stopping if
0:35
no formulas are found. Attempts to set formula cells to all cells in the active sheet that
0:40
contain formulas. Resets error handling to its default, where VBA stops on errors. If formula
0:46
cells are found, selects them. Otherwise, shows a message saying no formula cells were found
0:52
To test the macro, start by closing the VBA editor. Next, select the worksheet you want to
0:57
check for formulas and press Alt F8 to open the macro dialog box. Choose Select Formula Cells
1:03
from the list of macros and click Run. This will select all cells containing formulas in the active
1:08
worksheet. To test the functionality further, try deleting all of the formulas in the worksheet and
1:13
run the macro again. Excel should display a message box indicating that no formula cells
1:18
were found if there are no formulas present. Thanks for watching. Please like, share
1:23
and subscribe for more helpful tips