ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Converting a formula to its value (https://www.excelbanter.com/excel-programming/363622-converting-formula-its-value.html)

[email protected]

Converting a formula to its value
 
I am writing a program that updates a large excel workbook on a weekly
basis. There are a couple of worksheets that I copy in the current
weeks data and the remaining worksheets perform their calculations
based on the current data. Is there a way to convert the cells
containing formulas to their values, so that next week when I run the
program the previous weeks data will remain?

Thanks in advance.


Nick Hodge

Converting a formula to its value
 
Copy it and paste special...+Values over itself

Like this

Sub KillFormulas()
Dim myRng As Range
Set myRng = Range("A1:H18")
With myRng
.Copy
.PasteSpecial xlPasteValues
End With
Application.CutCopyMode = False
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
HIS


wrote in message
ups.com...
I am writing a program that updates a large excel workbook on a weekly
basis. There are a couple of worksheets that I copy in the current
weeks data and the remaining worksheets perform their calculations
based on the current data. Is there a way to convert the cells
containing formulas to their values, so that next week when I run the
program the previous weeks data will remain?

Thanks in advance.




Herve_Rob[_2_]

Converting a formula to its value
 

try this:
if your formula are in cell F56 to F9

Sub Macro1()
Range("F6:F9").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False
Range("F6").Select
Application.CutCopyMode = False
End Sub


--
Herve_Rob
------------------------------------------------------------------------
Herve_Rob's Profile: http://www.excelforum.com/member.php...o&userid=35204
View this thread: http://www.excelforum.com/showthread...hreadid=549684


Don Guillett

Converting a formula to its value
 
columms(1).value=columns(1).formula

--
Don Guillett
SalesAid Software

wrote in message
ups.com...
I am writing a program that updates a large excel workbook on a weekly
basis. There are a couple of worksheets that I copy in the current
weeks data and the remaining worksheets perform their calculations
based on the current data. Is there a way to convert the cells
containing formulas to their values, so that next week when I run the
program the previous weeks data will remain?

Thanks in advance.





All times are GMT +1. The time now is 07:17 AM.

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