ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Change cut/paste operation to cut/insert operation (https://www.excelbanter.com/excel-programming/381349-re-change-cut-paste-operation-cut-insert-operation.html)

Don Guillett

Change cut/paste operation to cut/insert operation
 
A very brief look suggests
With rToCut.EntireRow
.Copy Destination:=rDest


With rToCut.EntireRow.Cut
rDest.Insert

--
Don Guillett
SalesAid Software

"BluzDude" wrote in message
...
In the following code, how would I change the "paste" operation in the
"Done"
worksheet to an "insert" operation? I want the inserted data to appear
above
the existing data in the "Done" worksheet. The existing data starts in row
4
of that worksheet.

Public Sub CutToDone()
Dim rToCut As Range
Dim rDest As Range
With Sheets("Jobs")
On Error Resume Next
Set rToCut = .Range("F4:F" & .Range("F" & _
.Rows.Count).End(xlUp).Row).SpecialCells( _
xlCellTypeConstants)
On Error GoTo 0
End With
If Not rToCut Is Nothing Then
With Sheets("Done")
Set rDest = .Range("A" & _
.Rows.Count).End(xlUp).Offset(1, 0)
End With
With rToCut.EntireRow
.Copy Destination:=rDest
.Delete
End With
End If
End Sub





All times are GMT +1. The time now is 12:45 AM.

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