ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   A macro for converting formulas to formula results only (https://www.excelbanter.com/excel-programming/442117-macro-converting-formulas-formula-results-only.html)

Michael Lanier

A macro for converting formulas to formula results only
 
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

Bob Phillips[_4_]

A macro for converting formulas to formula results only
 
For Each cell In Range("A10:C200")

If cell.Value2 0 Then

cell.Value2 = cell.Value2
End If
Next cell

--

HTH

Bob

"Michael Lanier" wrote in message
...
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




Don Guillett[_2_]

A macro for converting formulas to formula results only
 
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

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Michael Lanier" wrote in message
...
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



Michael Lanier

A macro for converting formulas to formula results only
 
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


All times are GMT +1. The time now is 04:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com