A
A Doinel
I have a macro that creates a new workbook ("Book1") and
copies data from an open workbook ("existing.xls"). This
works fine unless you use the button twice, because the
macro always looks for "Book1".
I got around this by creating a global variable and
incrementing it when the button was pressed. However, this
has problems if you open a new workbook without using the
button.
Ideally I want to access the Application variable that
keeps track of the number of workbooks and use that in my
macro. Can anyone tell me the name of the variable and the
correct syntax for it's use?
Thank you for your help.
copies data from an open workbook ("existing.xls"). This
works fine unless you use the button twice, because the
macro always looks for "Book1".
I got around this by creating a global variable and
incrementing it when the button was pressed. However, this
has problems if you open a new workbook without using the
button.
Ideally I want to access the Application variable that
keeps track of the number of workbooks and use that in my
macro. Can anyone tell me the name of the variable and the
correct syntax for it's use?
Thank you for your help.