Delete formula if....

L

LiAD

Hi,

In a workboook of 15 sheets I have a lot of cells with formulas that will
return either useful data (numerical values or text) or nothing ("").

What sub could I use to get excel to check all of the sheets and delete the
formulas from cells that =""? All other cells need left as they are.

Thankyou
LiAD
 
S

Sam Wilson

Sub test()

Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets

Dim r As Range
Set r = ws.Cells.SpecialCells(xlCellTypeLastCell)

Dim c As Range
For Each c In ws.Range("A1", r.Address)
If c.Value = "" Then c.Formula = ""
Next c

Next ws
End Sub
 
L

LiAD

Great

Thanks

Sam Wilson said:
Sub test()

Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets

Dim r As Range
Set r = ws.Cells.SpecialCells(xlCellTypeLastCell)

Dim c As Range
For Each c In ws.Range("A1", r.Address)
If c.Value = "" Then c.Formula = ""
Next c

Next ws
End Sub
 

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