I have a macro that copies a worksheet in the current workbook to a new workbook and then saves that new workbook. What I want to do is to then go back to my original workbook, leaving the new one still open.
I know I need a command before the "Sheets("Full Quote Document").Activate" line to select my original workbook, but my problem is, I cannot hardcode the name of the workbook, because the user may save it under different names over time. So I want to have a way of recording the name of the original workbook at the start into a variable and then be shown how to then select the workbook using that variable.
Thanks,
MikeG
====================================
Dim wbNew As Workbook
ThisWorkbook.Worksheets("Full Quote For New").Copy
Set wbNew = ActiveWorkbook
With wbNew
.SaveAs Filename:=Range("Save_Name") & ".xlsx"
Application.DisplayAlerts = True
.Close
End With
Sheets("Full Quote Document").Activate
I know I need a command before the "Sheets("Full Quote Document").Activate" line to select my original workbook, but my problem is, I cannot hardcode the name of the workbook, because the user may save it under different names over time. So I want to have a way of recording the name of the original workbook at the start into a variable and then be shown how to then select the workbook using that variable.
Thanks,
MikeG
====================================
Dim wbNew As Workbook
ThisWorkbook.Worksheets("Full Quote For New").Copy
Set wbNew = ActiveWorkbook
With wbNew
.SaveAs Filename:=Range("Save_Name") & ".xlsx"
Application.DisplayAlerts = True
.Close
End With
Sheets("Full Quote Document").Activate