ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   cut and pasting a row in another workbook on the next available l. (https://www.excelbanter.com/excel-programming/338653-cut-pasting-row-another-workbook-next-available-l.html)

stressed

cut and pasting a row in another workbook on the next available l.
 
I want to record a macro which cuts a row from a sheet and pastes the row
into another sheet without deleting any existing rows.

bigwheel

cut and pasting a row in another workbook on the next available l.
 
Something like this will do the trick:-

ActiveCell.EntireRow.Select
Selection.Cut
Sheets("Sheet2").Select
Range("a65535").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste

"stressed" wrote:

I want to record a macro which cuts a row from a sheet and pastes the row
into another sheet without deleting any existing rows.


Gord Dibben

cut and pasting a row in another workbook on the next available l.
 
stressed

Sub Copyit()
Sheets("Sheet1").Range("1:1").Copy Destination:= _
Sheets("Sheet2").Cells(Rows.Count, 1).End(xlUp) _
.Offset(1, 0)
End Sub

Note: you could use Activesheet instead of Sheets("Sheet1") to make it more
generic.


Gord Dibben Excel MVP



On Mon, 29 Aug 2005 13:50:44 -0700, "stressed"
wrote:

I want to record a macro which cuts a row from a sheet and pastes the row
into another sheet without deleting any existing rows.




All times are GMT +1. The time now is 04:43 PM.

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