ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   removing formulas (https://www.excelbanter.com/excel-programming/293235-removing-formulas.html)

JohnE

removing formulas
 
I have a button on a worksheet that uses code to place the
information in the proper cells. As part of the code I
actually have the formula that would go directly into the
cell. Upon using the button, all works. But, I need to
have the formula removed and only the info sitting in the
cell. I thought I had the solution until I used it on a
range of cells. Ouch, that was an error on my part. What
is the range().??? = range().??? that emliminates the
formulas but retains the info in the cell?
Thanks in advance to anyone responding.
*** John

Trevor Shuttleworth

removing formulas
 
John

one way:

With Selection
.Copy
.PasteSpecial _
Paste:=xlValues, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False
End With

Regards

Trevor


"JohnE" wrote in message
...
I have a button on a worksheet that uses code to place the
information in the proper cells. As part of the code I
actually have the formula that would go directly into the
cell. Upon using the button, all works. But, I need to
have the formula removed and only the info sitting in the
cell. I thought I had the solution until I used it on a
range of cells. Ouch, that was an error on my part. What
is the range().??? = range().??? that emliminates the
formulas but retains the info in the cell?
Thanks in advance to anyone responding.
*** John




JE McGimpsey

removing formulas
 
Are you thinking of

With range(...)
.Value = .Value
End With

???
In article ,
"JohnE" wrote:

I have a button on a worksheet that uses code to place the
information in the proper cells. As part of the code I
actually have the formula that would go directly into the
cell. Upon using the button, all works. But, I need to
have the formula removed and only the info sitting in the
cell. I thought I had the solution until I used it on a
range of cells. Ouch, that was an error on my part. What
is the range().??? = range().??? that emliminates the
formulas but retains the info in the cell?
Thanks in advance to anyone responding.
*** John


Trevor Shuttleworth

removing formulas
 
John

following on JE's approach:

With Selection
.Value = .Value
End With

Much neater and quicker

Regards

Trevor


"Trevor Shuttleworth" wrote in message
...
John

one way:

With Selection
.Copy
.PasteSpecial _
Paste:=xlValues, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False
End With

Regards

Trevor


"JohnE" wrote in message
...
I have a button on a worksheet that uses code to place the
information in the proper cells. As part of the code I
actually have the formula that would go directly into the
cell. Upon using the button, all works. But, I need to
have the formula removed and only the info sitting in the
cell. I thought I had the solution until I used it on a
range of cells. Ouch, that was an error on my part. What
is the range().??? = range().??? that emliminates the
formulas but retains the info in the cell?
Thanks in advance to anyone responding.
*** John







All times are GMT +1. The time now is 09:36 PM.

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