Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying Data between files
Hi
I need to copy data between xls files. File One is a data entry file. I need to open File Two, look down column A to the last used reference no, add one this and insert it in the cell below. Then I need to copy specific cells from File One into cells on this row into columns B, C, D, E & F. Being a relative novice, any help will be assisted. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying Data between files
Hi,
Try the following code. You must record it into a module of you FILE 1. SUB copy() dim ACTUAL as string ACTUAL = ActiveWindow.Caption Workbooks.Open Filename:= _ "C:\My Documents\FILE 2.xls" dim NEW as string NEW = ActiveWindow.Caption sheets("sheet 1").select i = 1 ' being 1 the first line of your list t = True While t = True i = i + 1 If Cells(i, 1).Value = "" Then t = False 'being 1 the equivalent to column "A" Wend Range("B" & i).Select Windows(ACTUAL).Activate Range("A1").Copy 'Being A1 the cell where you have your data to copy. Windows(NEW).Activate Selection.Paste Range("C"&i).Select Windows(ACTUAL).Activate Range("A1").Copy Windows(NEW).Activate Selection.Paste .... .... 'etc, etc, as much columns you want to copy/paste. end sub I think it will work. Take care. -- Paulo Mónica "Steve" wrote: Hi I need to copy data between xls files. File One is a data entry file. I need to open File Two, look down column A to the last used reference no, add one this and insert it in the cell below. Then I need to copy specific cells from File One into cells on this row into columns B, C, D, E & F. Being a relative novice, any help will be assisted. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
copying data from several files to one excel file | Excel Programming | |||
Macro copying info/data in multiple excel files into one summary file. | Excel Programming | |||
Copying files in VB | Excel Programming | |||
Copying data from many files | Excel Programming | |||
Copying data across 2 xcel files | Excel Programming |