NewName = InputBox("Please Specify the name of your new workbook", "New Copy")
varPath = GetFolder("C:\")
if Right(varPath,1) <> "\" Then
varPath = varPath & "\"
End If
' Save it with the NewName and in the same directory as original
ActiveWorkbook.SaveCopyAs varPath & NewName & ".xlsx", FileFormat:=51
ActiveWorkbook.Close
ActiveWorkbook.Close SaveChanges:=False
Function GetFolder(strPath As String) As String
Dim fldr As FileDialog
Dim sItem As String
Set fldr = Application.FileDialog(msoFileDialogFolderPicker)
With fldr
.Title = "Select a Folder"
.AllowMultiSelect = False
.InitialFileName = strPath
If .Show <> -1 Then GoTo NextCode
sItem = .SelectedItems(1)
End With
NextCode:
GetFolder = sItem
Set fldr = Nothing
End Function
Bookmarks