ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Replacing formulas with its value (https://www.excelbanter.com/excel-worksheet-functions/111019-replacing-formulas-its-value.html)

Marcus A

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

Thanks.

Gary''s Student

Replacing formulas with its value
 
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

--
Gary's Student


"Marcus A" wrote:

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

Thanks.


Rodrigo Ferreira

Replacing formulas with its value
 
Try this:

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

Rodrigo Ferreira


"Marcus A" <Marcus escreveu na mensagem
...
I wanted to know if there was a macro that would replace all formulas in a
worksheet with their respective value only.

Thanks.




Brad

Replacing formulas with its value
 
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.

"Marcus A" wrote:

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

Thanks.


Gord Dibben

Replacing formulas with its value
 
Info only.

You don't need a macro to do this.

Just copy the range and editpaste specialvaluesOKEsc

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
wrote:

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

Thanks.




All times are GMT +1. The time now is 11:59 PM.

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