Shift a cut row up

R

Risky Dave

Hi,

I have some code that cuts a row from one sheet (Database) and pastes it
into another one (Archive):

Dim iSourceRow As Integer
Dim iTgtRow As Integer

Sheets("Database").Range(iSourceRow & ":" & iSourceRow).cut_
Destination:=Sheets("archive").Range(iTgtRow & ":" & iTgtRow)

This works fine except that I cannot get the Database sheet to shift up all
teh rows below the one that is cut (so that all the data rows are
contiguous). I have tried adding

Shift:= xlUp to the line above, but this generates an "Expected: end of
statement" error

Suggestions on how I can get the rows to move up woould be welcome.

TIA

Dave
 
P

Patrick Molloy

try this as an alternative:

Sheets("Database").Rows(iSourceRow).Copy
Sheets("archive").Rows(iTgtRow).PasteSpecial xlValues
Sheets("Database").Rows(iSourceRow).Delete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top