J
Jon Arbuckle
Hello all:
I have created macro in Excel that will essentially open a new workbook, and
copy certain cells off of certain pages to the new workbook. At the end, it
gives the user a chance to save it.
The problem is that as it references the different workbooks (the new one
just opened, and the source workbook), it will have problems if the filename
of the source file is changed (because I have it as a static name), and the
new workbook name differs depending on how long/many workbooks are opened
(i.e. book1, book12, book14, etc.).
I would like to assign the source workbook a name via a variable, and do the
same with the exported workbook. Can you show me how to do this? I am
quite an amateur when it comes to VB macros, so if you could give me a
little detail, or even examples I would appreciate it.
I would need to know how to define the variable based on the different file
names, AND how to incoporate it in a line such as this:
Windows("MY WINDOWS SPREADSHEET.xls").Activate
I have created macro in Excel that will essentially open a new workbook, and
copy certain cells off of certain pages to the new workbook. At the end, it
gives the user a chance to save it.
The problem is that as it references the different workbooks (the new one
just opened, and the source workbook), it will have problems if the filename
of the source file is changed (because I have it as a static name), and the
new workbook name differs depending on how long/many workbooks are opened
(i.e. book1, book12, book14, etc.).
I would like to assign the source workbook a name via a variable, and do the
same with the exported workbook. Can you show me how to do this? I am
quite an amateur when it comes to VB macros, so if you could give me a
little detail, or even examples I would appreciate it.
I would need to know how to define the variable based on the different file
names, AND how to incoporate it in a line such as this:
Windows("MY WINDOWS SPREADSHEET.xls").Activate