Rachel Welsh
New Member
- Joined
- Jun 2, 2016
- Messages
- 1
My coding for split workbook is crashing, can anyone help as I'm not sure as to the error
Sub Splitbook()
Dim Folder As String
Folder = "S:\Sales Ledger\2015-16\STATEMENTS\Month End Statement report\Statement drop box\"
For Each sht In ThisWorkbook.Sheets
sht.Copy
ActiveSheet.Cells.Copy
ActiveSheet.Cells.PasteSpecial Paste:=xlPasteValues
ActiveSheet.Cells.PasteSpecial Paste:=xlPasteFormats
ActiveWorkbook.SaveAs Filename:=Folder & sht.Name & ".xlsx"
ActiveWorkbook.Close savechanges:=False
Next sht
End Sub
Thank you
Sub Splitbook()
Dim Folder As String
Folder = "S:\Sales Ledger\2015-16\STATEMENTS\Month End Statement report\Statement drop box\"
For Each sht In ThisWorkbook.Sheets
sht.Copy
ActiveSheet.Cells.Copy
ActiveSheet.Cells.PasteSpecial Paste:=xlPasteValues
ActiveSheet.Cells.PasteSpecial Paste:=xlPasteFormats
ActiveWorkbook.SaveAs Filename:=Folder & sht.Name & ".xlsx"
ActiveWorkbook.Close savechanges:=False
Next sht
End Sub
Thank you