ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copying data to worksheets in another workbook that will change (https://www.excelbanter.com/excel-programming/343692-copying-data-worksheets-another-workbook-will-change.html)

GP

Copying data to worksheets in another workbook that will change
 
I want to create a macro that will copy data from one worksheet to another
worksheet in another workbook. In workbook "A" I have a worksheet named "GP"
with data in cells d41 and d44. I want the macro to copy the value in cell
d44, go to another workbook named "Freight", find the worsheet named the same
as the value in cell d41, go to the first empty row in column A, then paste
the value in that cell.
--
gp

Tom Ogilvy

Copying data to worksheets in another workbook that will change
 
With ActiveWorkbook.Worksheets("GP)
.Range("D44").Copy Destination:= _
Worksheets("Freight.xls").Worksheets(.Range("D41") .Value) _
.Cells(rows.count,1).End(xlup)(2)
End With

--
Regards,
Tom Ogilvy


"gp" wrote in message
...
I want to create a macro that will copy data from one worksheet to another
worksheet in another workbook. In workbook "A" I have a worksheet named

"GP"
with data in cells d41 and d44. I want the macro to copy the value in cell
d44, go to another workbook named "Freight", find the worsheet named the

same
as the value in cell d41, go to the first empty row in column A, then

paste
the value in that cell.
--
gp




GP

Copying data to worksheets in another workbook that will chang
 
Tom:
I really appreciate your help, but unfortunately I wasn't able to get it to
work. I'm a novice at code. I really only know how to record macros. Is there
a similar solution which would begin with "Sub" and end with "End Sub" that I
could then initiate with a command button?

Best regards,
Greg
--
gp


"Tom Ogilvy" wrote:

With ActiveWorkbook.Worksheets("GP)
.Range("D44").Copy Destination:= _
Worksheets("Freight.xls").Worksheets(.Range("D41") .Value) _
.Cells(rows.count,1).End(xlup)(2)
End With

--
Regards,
Tom Ogilvy


"gp" wrote in message
...
I want to create a macro that will copy data from one worksheet to another
worksheet in another workbook. In workbook "A" I have a worksheet named

"GP"
with data in cells d41 and d44. I want the macro to copy the value in cell
d44, go to another workbook named "Freight", find the worsheet named the

same
as the value in cell d41, go to the first empty row in column A, then

paste
the value in that cell.
--
gp






All times are GMT +1. The time now is 08:49 AM.

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