I
iashorty
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?
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?