I had a code that copy a TEMPLATE workbook and save it with new name that
depend on the value enetered on Textbox1. When the file exists, Excel gave a
msgbox and the user press Yes or No depends of they want to replace the file.
That I want is add to my code that when the user press "NO", my macro stop
running. How can I do that? My code is:
'**************************************************************************************
' Make a Template workbook copy. This copy will be named as the Lot Number
entered.
'*********************************************************
Set WkbTemp = Workbooks.Open(Filename:=tempFullName)
ActiveWorkbook.SaveAs Filename:="\\mypath\" & NewFileName & ".xls"
'THE LINE THAT I NEED TO ADD
|