Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy from File 1 to File 2
I am trying to write a macro that copies from File_1 to File_2.
Background: The items to copy are not always in the same place. I have written a formula to put an X in column A each time I need to start copies. IF A1 has an X in it then I need to copy from B1, C2, D7 and C30-G30. These cells are copied to File_2, to Cells A1-A9. Each time they go down a row in File_2 so that I have a chart when finished of accumulated data. File 2 name changes so I use an identifying name called File_2 rather than an exact windown name. This is what I have written so far: Windows(File_2).Activate Range("A1").Select X = ActiveCell.Row Do While X < 65532 If Cells(X, 1) = "" Then X = X + 1 Else If Cells(X, 1) = X Then RangeRC1.Select Selection.Copy Windows("File_1.xls").Activate Sheets("Import").Select ActiveCell.Offset(1, 0).Range("A1").Select ActiveSheet.Paste Windows(File_2).Activate RangeR1C3.Select Selection.Copy Windows("File_1.xls").Activate Sheets("Import").Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Paste End If End If Loop This of course isn't working. Can someone give me direction? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
copy data for match word from one file to another file | Excel Worksheet Functions | |||
copy the same raws of all sheets from about a 100 file to a new sheet of a book and save the file | Setting up and Configuration of Excel | |||
macro to autofilter other file and copy in opened file | Excel Programming | |||
VBA Macro to copy an column from one Excel file into another file | Excel Programming |