Copy, Paste, check and just about everything else!

Audiojoe

Active Member
Joined
Feb 20, 2002
Messages
285
Hi all,

I need some code to do the following:

When I press a button it copies the active row and pastes it in the next available row in a sheet called 'Completed'. Can anyone help?
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Hello AudioJoe

How about

Sub DoIt()
ActiveCell.EntireRow.Copy Destination:= _
Sheets("Completed").Range("A65536").End(xlUp).Cells(2, 1)
End Sub
 
Upvote 0
It's giving me run time error 1004 on that mate, it says:

Copy Method of Range Class Failed

Any ideas?
 
Upvote 0
I tried putting into a command button click event, but that didn't work, so I decided to leave it as a macro and just put Run ("DoIt") on the end of the command button click commands, but that didnt work either
 
Upvote 0
Hi
This works.

Sub nextrow()
Dim ThisRow
Dim LastRow
Dim ReturnToSheet

ThisRow = ActiveCell.Row
ReturnToSheet = ActiveSheet.Name
ActiveSheet.Rows(ThisRow & ":" & ThisRow).Copy
Sheets("Complete").Activate
LastRow = Sheets("Complete").Range("a1:A" & Range("A65536").End(xlUp).Row).Rows.Count + 1
ActiveSheet.Rows(LastRow & ":" & LastRow).Select
ActiveSheet.Paste
Sheets(ReturnToSheet).Activate
End Sub

Have a nice day!
Tom
 
Upvote 0
I keep getting the same problem. The code that Tom gave me works fine up to the:

Activesheet.Paste

command. Here it says 'Paste Method of Worksheet Class failed'

You can't tell, but I'm shrugging right now
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,142
Members
448,551
Latest member
Sienna de Souza

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
Back
Top