Is it possible to use a 'Clear Cell Contents' Macro without it cl.

A

anavrin

Hi! I'm currently working on a sheet which contains a lot of different
formulas in specific cells. What I want to do is to create a 'Clear Cells'
Macro to clear the specific cells without it clearing the formulas in the
cells. Is this possible ??????
 
K

kkknie

I don't understand, what would you be clearing? Do you mean that yo
would not want to see the formula or its result? If so, you could jus
set the font color to white so it doesn't show up.

Range("A1").Font.ColorIndex = 2
 
G

Gord Dibben

anarvin

Sub ClearItOut()
Cells.Select
Selection.SpecialCells(xlCellTypeConstants, 1).Select
Selection.ClearContents
End Sub

You can do the same manually by CRTL + A to select all cells.

F5>Special>Constants>Uncheck all but "Numbers" and OK

With number cells selected, right-click and "Clear Contents"

Gord Dibben Excel MVP
 
Top