ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   multiple workbooks reference (https://www.excelbanter.com/excel-programming/331620-multiple-workbooks-reference.html)

Mitch

multiple workbooks reference
 
How do I copy & paste information contained in cells from one open workbook
to others most easily?

STEVE BELL

multiple workbooks reference
 
This is a previous reply I gave for transfering from multiple workbooks to a
master workbook.
Change to fit your needs. The only tricky part is to identify each workbook
and each worksheet.
(watch out for word wrap)

Let's say that you open a workbook and transfer
Open the next workbook and transfer
and so on....
With this code in the master workbook...

than for each transfer - open a workbook

dim rw1 as Long, rw2 as Long

' find first open row in each workbook
rw1 = Thisworkbook.Sheets("MySheet").Cells(Rows.COUNT,
"A").End(xlUp).Offset(1, 0).Row
rw2 = Activeworkbook.ActiveSheet.Cells(Rows.COUNT, "A").End(xlUp).Offset(1,
0).Row

' transfer opened worksheet to master worksheet
Activeworkbook.ActiveSheet.Range(Cells(5,18),Cells (rw2,18).Copy _
Destination:= Thisworkbook.Sheets("MySheet").Cells(rw1,1)


You could set some conditions on rw1 like this:
If rw1<5 then
rw1 = 5
End If


--
steveB

Remove "AYN" from email to respond
"Mitch" wrote in message
...
How do I copy & paste information contained in cells from one open
workbook
to others most easily?





All times are GMT +1. The time now is 01:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com