Below macro saves every worksheet to a new workbook. It is running fine. The only thing I cannot change is the file format to which the individal worksheets are to be saved. Below code only saves them as .xlsx. I would like to get them saved as "xlsm".
How is this done?
Help is much appreciated. Thank you very much in advance.
Dim NewBook As Workbook, OldBook As Workbook, sh As Worksheet
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
' xlWorkbookDefault (.xlsx)
Set OldBook = ThisWorkbook
For Each sh In OldBook.Worksheets
If sh.Visible = True Then
ActiveWorkbook.SaveAs Filename:=OldBook.Path & "\" & sh.Name & "VALUES", FileFormat:=xlWorkbookDefault
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic