Replacing formulas with its value

M

Marcus A

I wanted to know if there was a macro that would replace all formulas in a
worksheet with their respective value only.

Thanks.
 
G

Gary''s Student

Try:

Sub gsnu()
Dim r As Range
For Each r In ActiveSheet.UsedRange
If r.HasFormula Then
r.Value = r.Value
End If
Next
End Sub
 
R

Rodrigo Ferreira

Try this:

Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False
Application.CutCopyMode = False

Rodrigo Ferreira
 
B

Brad

Something for you to think about
Select the entire worksheet - by left click the box to the left of the "A"
and above the number "1" - then copy - then paste special - values - don't
need a macro to do that.
 
G

Gord Dibben

Info only.

You don't need a macro to do this.

Just copy the range and edit>paste special>values>OK>Esc

If you want a macro, turn on the macro recorder while doing the above steps.

OR use the macro provided by Gary's student.


Gord Dibben MS Excel MVP

On Thu, 21 Sep 2006 08:12:02 -0700, Marcus A <Marcus
 
Top