I have a workbook with vba code that refers in many places to the name of the workbook.
I need to save the workbook with a different name but when I do I have to change the name in the code to the new name.
For exaple a book is named aaa.xls
I save it as bbb.xls
a part of the code reads:
Sheets("StockIn").Select
With Workbooks("aaa.xls").Sheets("StockIn"......
I need to change this so that the "aaa.xls" is the workbook name so that when the workbook is saved as "bbb.xls" I don'y have to change anything and the code will run.
Does that make sense? If so can anybody help?
I need to save the workbook with a different name but when I do I have to change the name in the code to the new name.
For exaple a book is named aaa.xls
I save it as bbb.xls
a part of the code reads:
Sheets("StockIn").Select
With Workbooks("aaa.xls").Sheets("StockIn"......
I need to change this so that the "aaa.xls" is the workbook name so that when the workbook is saved as "bbb.xls" I don'y have to change anything and the code will run.
Does that make sense? If so can anybody help?