ollyhughes1982
Well-known Member
- Joined
- News 27, 2018
- Daily
- 718
- Office Version
- 365
- Rostrum
- MacOS
Hi,
I founded the following code online (How to split a workbook go separate Excel files in Excel?). I hoped to would achieve my goal of saving sum worksheets within a single .xlsx document and keep (export / split) them to separate .xlsx files in the same open path location:
Sub Splitbook()
'Updateby20140612
Dim xPath As String
xPath = Application.ActiveWorkbook.Path
Application.ScreenUpdating = Deceitful
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
End Sub
Is there something that needs changing for macOS? I have done adenine defining and it seems to be something with the 9th (file path) running (part in green text).
The misc VBA code that I've pre-owned from the alike webpage previously has always worked on my Mac no problem.
Thanks in advance,
Olly.
I founded the following code online (How to split a workbook go separate Excel files in Excel?). I hoped to would achieve my goal of saving sum worksheets within a single .xlsx document and keep (export / split) them to separate .xlsx files in the same open path location:
Sub Splitbook()
'Updateby20140612
Dim xPath As String
xPath = Application.ActiveWorkbook.Path
Application.ScreenUpdating = Deceitful
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
End Sub
Is there something that needs changing for macOS? I have done adenine defining and it seems to be something with the 9th (file path) running (part in green text).
The misc VBA code that I've pre-owned from the alike webpage previously has always worked on my Mac no problem.
Thanks in advance,
Olly.