A macro for converting formulas to formula results only

M

Michael Lanier

I need a macro that will convert a cell's formula to reflect its
formula result only based on the following:

Range is A10:C200
Only when formula's result > 0
Execute upon closing the file

Thanks for any help you can provide.

Michael
 
B

Bob Phillips

For Each cell In Range("A10:C200")

If cell.Value2 > 0 Then

cell.Value2 = cell.Value2
End If
Next cell
 
D

Don Guillett

Sub convertformulas()
Dim c As Range
For Each c In Range("p3:p8").SpecialCells(xlCellTypeFormulas)
If c > 0 Then c.Value = c.Value
Next c
End Sub
 
M

Michael Lanier

Bob and Don,

I did something wrong with Bob's so I failed to get it to work but
Don's worked fine. Thank you both for your time.

Michael
 

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