Select All Cells With Formula In It
Let say we want to distinguish between ordinary cells and cells with formula in it, so we give a special background color to the cells with formula.
For doing it manually is time consuming, especially on Excel Worksheet with large of cells with formula in it (usually a very complex worksheet).
The following vba macro code will do the trick for us.
Sub SelectAllCellsWithFormula()
'select all cell with formula
Cells.SpecialCells(xlCellTypeFormulas).Select
'change cell background color
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent1
.TintAndShade = 0.399975585192419
.PatternTintAndShade = 0
End With
End Sub
FIN
Related Entries
External Resources
- Microsoft Excel 2003/2007 Video Tutorials
Step-by-step video guide to mastering Charts, PivotTable, Data Analysis and Macro programming in Microsoft Excel in 5 hours.
- 101 Secrets of Microsoft Excel
Discover 101 of Excels little-known secrets that have been hiding right under your nose.
Tagged with: cell with formula, excel special cells, macro code, vba macro
Number of Cells/Rows/Columns With Formula | Excel VBA Macro Tutorial and Examples
[...] my previous post, we already have the Excel VBA code on how to select all cells with formula, so we only need to tweak this macro a little bit and get the results that we looking for. Sub [...]