Hi all,
I want to make a macro that allows me to easily save worksheets as new workbooks in the same path as the original workbook.
This is what I got so far:
Sub SaveWorksheet()
Dim wb As Workbook
Dim Start As String
Dim Finish As String
Dim Name As String
Start = Sheets("Example").Range("F5")
Finish = Sheets("Example").Range("M5")
Sheets("Example").Copy
Set wb = ActiveWorkbook
Name = "Text" & " " & Start & "" & " - " & "" & Finish
With wb
.SaveAs ThisWorkbook.Path & "\Name.xlsx"
wb.Close
End With
End Sub
In this code 'Start' and 'Finish' are dates in cells.
The only problem is that the worksheet isn't saved with the name I gave it behind 'Name' but actualy with the name Name.xlsx..
Is there any easy way that can fix my problem?
Hope you have some tips
- Daan
Bookmarks