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 pop up button on mouse right click menu and as soon as you click on it . It shows you multiple buttons with macro a...
-
Macro to import data from SQL using ADO connection string: Sub Import_data_from_SQL() ' Tools -> References -> Microsoft Active...
No comments:
Post a Comment