View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] cfatz1@gmail.com is offline
external usenet poster
 
Posts: 36
Default 2 Files open - Paste to One

Hi-

I have a macro saved in a file ("Macro1.xls"). This macro opens a
file.....does it's thing...closes the file....opens the next
file....does it's thing....closes that file.....etc. This goes on for
over 100 files.

I just added a copy and paste feature that grabs cell values from the
"Macro1.xls" file and pastes them into the open file. The problem I
have is the name of these files changes from day to day. Currently I
have this code which works for a file with the specific file name
"Chris.xls":

Windows("Macro1.xls").Activate
Sheets("Sheet5").Select
Rows("1:2").Select
Selection.Copy
Windows("Chris.xls").Activate
Selection.Insert Shift:=xlDown

Can anyone recommend some code that will paste this value in the file
that is open that is not named "Macro1.xls"?? The only two Excel files
that will be open when this macro runs are the macro file and the final
data file.

TIA!

-Chris