What is the syntax for the open workbook in a Macro?
I have a workbook with multiple sheets that gets updated weekly. The file
has a new name for each week. I want to copy selected data from a few sheets
in the workbook with the unique names into a static workbook with a constant
name that is used to import data into an access database. I recorded a maco
in the template that the source weekly workbooks are created from that once
opened, will open the target workbook clear out all old data and copy in the
desired data then save and close the workbook with the constant name. The
problem I have is the recorded maco is using the path and file name of the
source workbook from when the macro was first recorded. This becomes invalid
once a new week workbook is created and the process needs to be repeated
since the file name has changed. How can I modify the recorded macro to use
the data in the already opened workbook to copy into the other so the name
will never change?
|