Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
help excel
how can I copy specific range of cells from one workbook to another
|
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
help excel
Hello Ivica Lopar, Susbstitute your workbook names and ranges in place of the ones in the example. This example assumes 2 workbooks are open: Book1.xls and Book2.xls. The macro copies the range A1:A5 from Book1.xls, Sheet1 to Book2.xls, Sheet1 range B1:B5. Code: -------------------- Public Sub CopyRanges() Sub CopyRange() Dim dstRng As Excel.Range Dim srcRng As Excel.Range Set dstRng = Workbooks("Book2.xls").Worksheets("Sheet2").Range( "B1:B5") Set srcRng = Workbooks("Book1.xls").Worksheets("Sheet1").Range( "A1:A5") srcRng.Copy dstRng.Value End Sub -------------------- Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=484597 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
help excel
Dim sh1 as Worksheet, sh2 as Worksheet
set sh1 = Workbooks("Book1.xls").WorkSheets("Sheet1") set sh2 = Workbooks("Book2.xls").Worksheets("Sheet3" sh1.Range("a1:B10").copy Destination:=sh2.Range("F9") -- Regards, Tom Ogilvy "Ivica Lopar" wrote in message ... how can I copy specific range of cells from one workbook to another |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|