Hello,
I am trying to close a workbook using a named range. I use the named range to open the workbook,
Workbooks.Open Range("ABCCDM")
but cannot reciprocate when I go to close the workbook. For example I have a named range called "ABCCDM". The cell contains the file name I want to open ex "05-03-2010 ABC.xls". Once it is open I copy and paste data into another workbook. After pasting I want to close the 05-03-2010 ABC.xls workbook. It no longer serves me any purpose.
Using the code
Windows("5-03-10 ABC.xls").Activate
ActiveWindow.Close
does not work because the date will change monthly (6-02-2010 this month). I don't know how to get the macro to go back to the opened workbook to close it using my named range (which has the filename in it).
Any help would be greatly appreciated. Thanks.
I am trying to close a workbook using a named range. I use the named range to open the workbook,
Workbooks.Open Range("ABCCDM")
but cannot reciprocate when I go to close the workbook. For example I have a named range called "ABCCDM". The cell contains the file name I want to open ex "05-03-2010 ABC.xls". Once it is open I copy and paste data into another workbook. After pasting I want to close the 05-03-2010 ABC.xls workbook. It no longer serves me any purpose.
Using the code
Windows("5-03-10 ABC.xls").Activate
ActiveWindow.Close
does not work because the date will change monthly (6-02-2010 this month). I don't know how to get the macro to go back to the opened workbook to close it using my named range (which has the filename in it).
Any help would be greatly appreciated. Thanks.