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

G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top