ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Copy data in a macro. (https://www.excelbanter.com/excel-discussion-misc-queries/150096-copy-data-macro.html)

jfaz

Copy data in a macro.
 
I have recorded a macro to copy formula from one cell to a range of cells
using end and down arrow key in the macro to pick up the last record based on
the column to the left, this has dropped into the macro the last cell
reference. How can I include in the macro to copy to the last record line
(which could be variable)

Mike H

Copy data in a macro.
 
Hi,

Copies the last used cell in column A.

Sub versive()
Cells(Rows.Count, 1).End(xlUp)(1).Select
Selection.Copy
End Sub

Rows.Count, 1) change 1 to to for col B etc

Mike

"jfaz" wrote:

I have recorded a macro to copy formula from one cell to a range of cells
using end and down arrow key in the macro to pick up the last record based on
the column to the left, this has dropped into the macro the last cell
reference. How can I include in the macro to copy to the last record line
(which could be variable)



All times are GMT +1. The time now is 07:40 PM.

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