Select All Cells With Formula In It

Posted on the October 25th, 2008 under Cells and Range by Poer @ Excel VBA/Macro

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

Tagged with:

One Response to 'Select All Cells With Formula In It'

Leave a Reply




XHTML:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
SYNTAX HIGHLIGHTER:
Place your VBA code between <pre> tags like this <pre class="brush:vb"> sub vba() ... end sub </pre>.