If you want to save each worksheet of a workbook as separate new workbook and then save the new workbook with sheet name.
Download Working File
Here is the code-
Option Explicit
Sub splitsheets()
Dim wk As Worksheet, wkb As Workbook
' loop through each worksheet
For Each wk In ThisWorkbook.Sheets
' save it in new workbook
wk.Copy
' save the new workbook with sheet name
ActiveWorkbook.SaveAs ThisWorkbook.Path & "\" & wk.Name & ".xlsx"
' close the newly created workbook
ActiveWorkbook.Close
Next
End Sub
Subscribe to:
Post Comments (Atom)
Import data from SQL
Macro to import data from SQL using ADO connection string: Sub Import_data_from_SQL() ' Tools -> References -> Microsoft Active...
-
If you want to add a new menu on mouse right click "Workbook Navigation showing you the list of all open workbooks and worksheets in ea...
-
Macro to Export Range in Json Format Option Explicit Sub export_in_json_format() Dim fs As Object Dim jsonfile Dim rangetoex...
No comments:
Post a Comment