Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copying data from several files to one excel file sharman Excel Programming 2 June 2nd 06 02:35 PM
Macro copying info/data in multiple excel files into one summary file. Jskasango Excel Programming 10 April 6th 06 08:27 AM
Copying files in VB Reney R. Langlois Excel Programming 1 September 29th 04 08:34 PM
Copying data from many files David Excel Programming 1 June 30th 04 06:32 PM
Copying data across 2 xcel files Gandei Excel Programming 1 December 5th 03 04:58 PM


All times are GMT +1. The time now is 06:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"