Dear all,
I have a macro which splits worksheets of a file in different files.
But it does not work in excel 2010. It pops up error if I run in excel 2010.
Please assist.
Sub Splitbook()
MyPath = ThisWorkbook.Path
For Each sht In ThisWorkbook.Sheets
sht.Copy
ActiveSheet.Cells.Copy
ActiveSheet.Cells.PasteSpecial Paste:=xlPasteAll
Range("A1").Select
CellName = Range("e1").Value
ActiveWorkbook.SaveAs _
Filename:=MyPath & "\" & "RCost Unitwise " & CellName & "_" & sht.Name & ".xls" _
, FileFormat:=xlExcel8
ActiveWorkbook.Close savechanges:=False
Next sht
MsgBox "File Save As Completed"
End Sub
Bookmarks