Copy certain cells to another workbook (macro)

Tubig

Board Regular
Joined
Feb 20, 2003
Messages
66
I've tried searching for a few hours on this but I couldn't find exactly what I was looking for.

Is there way to create a macro to copy a few cells from one workbook and paste them into another at the bottom of the next open cell?

I found this code to get to the bottom of a page but that's as far as I got. :eek:

Sub FindFirstCellNextRow()
Dim x As Integer
x = ActiveSheet.UsedRange.Rows.Count
ActiveCell.SpecialCells(xlLastCell).Select
ActiveCell.EntireRow.Cells(1, 1).Offset(1, 0).Activate
End Sub

Any help would be greatly appreciated! :biggrin:
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,300
Office Version
  1. 365
Platform
  1. Windows
Sounds perfectly possible.:)

What cells do you actually want to copy and where do you want to copy them to?
 

Tubig

Board Regular
Joined
Feb 20, 2003
Messages
66
Sounds perfectly possible.:)


What cells do you actually want to copy and where do you want to copy them to?

Thanks for the quick reply!

I want to copy row A1 from workbook "Purchase Order.xls on Sheet1" to workbook "Construction Schedule on Sheet2". I want it to copy that row to the next open row on that sheet.

I hope that makes sense. :oops:
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,300
Office Version
  1. 365
Platform
  1. Windows
Well that could be as simple as this.:)
Code:
Workbooks("Purchase Order.xls").Sheets("Sheet1").Rows(1).Copy Workbooks("Construction Schedule.xls").Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1)
 

Tubig

Board Regular
Joined
Feb 20, 2003
Messages
66

ADVERTISEMENT

Well that could be as simple as this.:)
Code:
Workbooks("Purchase Order.xls").Sheets("Sheet1").Rows(1).Copy Workbooks("Construction Schedule.xls").Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1)

Thanks guys but i can't get it to work right.

I don't know how to enter the path correctly. This is what I have so far:

Sub FindFirstCellNextRow()
Workbooks("P:\1 - 2006 MASTERS.xls").Sheets("JOB SUMMARY").Rows(3).Copy Workbooks("Q:\CONSTRUCTION SCHEDULE\Book1.xls").Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Offset(1)

Dim x As Integer
x = ActiveSheet.UsedRange.Rows.Count
ActiveCell.SpecialCells(xlLastCell).Select
ActiveCell.EntireRow.Cells(1, 1).Offset(1, 0).Activate
End Sub

I don't know codes very well. Any help? :oops:
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,300
Office Version
  1. 365
Platform
  1. Windows
Why did you include the paths?

The code I posted assumed both workbooks were open.
 

Tubig

Board Regular
Joined
Feb 20, 2003
Messages
66
Why did you include the paths?

The code I posted assumed both workbooks were open.

ohhhh. OK. I'll give that another try.

Thanks again for all of your help! :biggrin:
 

Forum statistics

Threads
1,136,994
Messages
5,679,030
Members
419,800
Latest member
spvsr999

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top