Deleting Cells, but not ones with formulars

S

scriblesvurt

Hello,

I have a large sheet that people enter data into each week. I want t
be able to hightlight a large area of the sheet and delete the data i
those selected cells, but not the formulars that are in some of th
cells.

Anyone know how I can do this?

Any help apreciated!
 
M

mangesh_yadav

This worked for me:

Sub DeleteCells()

Set rng = Range("A1:B2")

For Each cl In rng
MsgBox cl.Formula
If cl.Formula = True Then
cl.ClearContents
End If
Next


End Sub


Put the code in a standard module and run.


Manges
 
S

scriblesvurt

Hi,

This works apart from It puts up an OK box that you have to click fo
each cell. This is a lot of clicking to clear 200+ cells. Any way t
change it so that it just runs right through?

Thanks,
 
D

Dave Peterson

Another way.

Select your cells to clean up.
Edit|goto|Special
click Constants
click ok
hit the delete key on the keyboard.

Don't select any cells that have labels you want to keep
(headers/instructions/etc).
 
Top