Hi All,
I think this will be very simple, but I'm not sure where exactly to tweak which line. I have the Vba below which works wonders to split the current workbook into new files for each sheet. My one change I need is to have it save each file with the values in the cells and not the formulas used to populate the values.
Currently it saves a duplicate of the sheet with formulas so when it is sent the numbers don't populate correctly.
Can someone please help edit this Vba code to save the sheets as a value version of itself but keep everything else the same(formatting, color etc)?
I need to have the sheet remain with formulas as well since it will feed in updates based on the other master sheets as well.. So I cannot simply copy and paste value of this sheet before the split.
Sub Splitbook()
Dim xWs As Worksheet
Dim xPath As String
xPath = Application.ActiveWorkbook.Path & "\Carrier Files"
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
Sheets("Landing Page").Select
MsgBox ("Done.")
End Sub
I think this will be very simple, but I'm not sure where exactly to tweak which line. I have the Vba below which works wonders to split the current workbook into new files for each sheet. My one change I need is to have it save each file with the values in the cells and not the formulas used to populate the values.
Currently it saves a duplicate of the sheet with formulas so when it is sent the numbers don't populate correctly.
Can someone please help edit this Vba code to save the sheets as a value version of itself but keep everything else the same(formatting, color etc)?
I need to have the sheet remain with formulas as well since it will feed in updates based on the other master sheets as well.. So I cannot simply copy and paste value of this sheet before the split.
Sub Splitbook()
Dim xWs As Worksheet
Dim xPath As String
xPath = Application.ActiveWorkbook.Path & "\Carrier Files"
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
Sheets("Landing Page").Select
MsgBox ("Done.")
End Sub