Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copying between workbooks | Excel Discussion (Misc queries) | |||
Copying workbooks | New Users to Excel | |||
copying workbooks | Excel Worksheet Functions | |||
Copying from other Workbooks | Excel Discussion (Misc queries) | |||
Copying from several workbooks into one | Excel Programming |