Visual Basic - Excel save every sheet as xls - office1997 - compatible
1. Alt+F11
2. Insert -> Module
(paste code)
3. Run - > F5
2. Insert -> Module
(paste code)
Sub Splitbook()
MyPath = ThisWorkbook.Path
For Each sht In ThisWorkbook.Sheets
sht.Copy
ActiveSheet.Cells.Copy
ActiveSheet.Cells.PasteSpecial Paste:=xlPasteValues
ActiveSheet.Cells.PasteSpecial Paste:=xlPasteFormats
ActiveWorkbook.SaveAs _
Filename:="c:\tmp" & "\" & sht.Name & ".xls", FileFormat:=56
ActiveWorkbook.Close savechanges:=False
Next sht
End Sub
3. Run - > F5
Comentarii
Trimiteți un comentariu