Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default need help for copying among workbooks

Sub CopyBooks1234()
Dim sh1 as Worksheet, sh2 as Worksheet
Dim sh3 as Worksheet, sh4 as Worksheet
Dim sh5 as Worksheet, fName as Variant
dim bk5 as Workbook, rng as Range
fName = Application.GetOpenfileName()
if fName = False then exit sub
set bk5 = workbooks.Open(fName)

set sh1 = workbooks("Workbooks1.xls").Worksheets("Sheet1")
set sh2 = workbooks("Workbooks2.xls").Worksheets("Sheet1")
set sh3 = workbooks("Workbooks3.xls").Worksheets("Sheet1")
set sh4 = workbooks("Workbooks4.xls").Worksheets('Sheet1")
set sh5 = bk5.Worksheets(2)
set rng = sh5.cells(1,"IV").End(xltoLeft)(1,2)
sh1.columns(1).Resize(10).Copy destination:=rng
sh2.columns(1).Resize(10).Copy destination:=rng.Offset(0,10)
sh3.columns(1).Resize(10).Copy destination:=rng.Offset(0,20)
sh4.columns(1).Resize(10).Copy destination:=rng.Offset(0,30)
end Sub

--
Regards,
Tom Ogilvy


"snow" wrote in message
...
Hello everyone, these are the facts:
I need to copy data from some columns of sheet1 of workbook1 to sheet2
of workbook5
then do the same thing (sequentially) for workbook 2,3,4 , just
copying their A-J columns to sheet2 of workbook5...and the columns
from WB2,3,4 need to be pasted in the first empty column of sheet2 of
WB5

I also need to be able to select (browsing in my hard disk) the file
representing workbook5.

I think a way is to define a macro for WB 1,2,3,4 that allows me to
select the column I want to copy and paste and put them in the first
empty column of sheet2 of WB5...

really hope sone can help me...:((



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 between workbooks Brad Excel Discussion (Misc queries) 2 January 9th 08 08:22 PM
Copying workbooks Nadji New Users to Excel 4 October 5th 06 03:16 PM
copying workbooks Nadji Excel Worksheet Functions 3 October 4th 06 08:43 PM
Copying from other Workbooks SusieQ Excel Discussion (Misc queries) 0 January 30th 06 12:44 PM
Copying from several workbooks into one Anthony Gobel Excel Programming 0 April 6th 04 09:56 PM


All times are GMT +1. The time now is 11:45 PM.

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

About Us

"It's about Microsoft Excel"