Hello!
I am very new to Excel macros (read: i know nothing). But i've found this macro online, which saves all sheets/tabs as workbooks. It uses the sheet names to create the file names, and saves them all in the same folder as the original:
I've also found this code, which saves all Worksheets as values instead of formulas:
And I kinda want to combine these two somehow, so that the output files of the first formula contains only values. However i only want the new files to be formula-free, not the original document. I still want the formulas to be in the original. Code-wise i think i would probably either need a code that opens every file except the original, and runs the PasteValues-script on all of them.. Or some code that makes a copy of all sheets, saves them as values, then deletes the copies again. But I don't really know and have no idea how to even start on either, so any help would be appreciated
I am very new to Excel macros (read: i know nothing). But i've found this macro online, which saves all sheets/tabs as workbooks. It uses the sheet names to create the file names, and saves them all in the same folder as the original:
Sub Splitbook()
'Updateby20140612
Dim xPath As String
xPath = Application.ActiveWorkbook.Path
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each xWs In ThisWorkbook.Sheets
xWs.Copy
Application.ActiveWorkbook.SaveAs fileName:=xPath & "\" & xWs.Name & ".xlsx"
Application.ActiveWorkbook.Close False
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
I've also found this code, which saves all Worksheets as values instead of formulas:
Sub Saveasvalue()
'Updateby Extendoffice
Dim wsh As Worksheet
For Each wsh In ThisWorkbook.Worksheets
wsh.Cells.Copy
wsh.Cells.PasteSpecial xlPasteValues
Next
Application.CutCopyMode = False
End Sub
And I kinda want to combine these two somehow, so that the output files of the first formula contains only values. However i only want the new files to be formula-free, not the original document. I still want the formulas to be in the original. Code-wise i think i would probably either need a code that opens every file except the original, and runs the PasteValues-script on all of them.. Or some code that makes a copy of all sheets, saves them as values, then deletes the copies again. But I don't really know and have no idea how to even start on either, so any help would be appreciated