ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Save Data not Formulas (https://www.excelbanter.com/excel-discussion-misc-queries/37321-save-data-not-formulas.html)

Charles

Save Data not Formulas
 
Is there a way to save just the data in a spreadshhet and not the formulaes
from a VBA Module.
--
CharlesM

Dave Peterson

For each worksheet in that workbook, you can copy|paste special|values and save
it as a new workbook.

Option Explicit
Sub testme()

Dim wks As Worksheet
Dim newWkbk As Workbook

ActiveWorkbook.Worksheets.Copy 'to a new workbook
Set newWkbk = ActiveWorkbook

For Each wks In newWkbk.Worksheets
With wks.UsedRange
.Copy
.PasteSpecial Paste:=xlPasteValues
End With
Next wks

Application.CutCopyMode = False

MsgBox "Please save this new workbook!"

End Sub


Charles wrote:

Is there a way to save just the data in a spreadshhet and not the formulaes
from a VBA Module.
--
CharlesM


--

Dave Peterson


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

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