VBA Code to Copy and Paste

Eakes03

New Member
Joined
May 26, 2009
Messages
7
I am new to VBA and need some help.

I have a worksheet named "Registration" where the data is located that I need to copy and a worksheet named "Player_List" where the data needs to be pasted in the first empty cell. I am getting a Runtime Error 1004 on the code below:

Sub Copy_to_Player_List()
Sheets("Registration").Select
Range("$A$14:$B$50").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Player_List").Select
Range("A65536").End(xlUp).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End Sub

The Error is coming from: Range("A65536").End(xlUp).Offset(1, 0).Select

What am I doing wrong?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
I think your code is correct, I tested it out and it works just fine. However, you might want to watch were you post it. When I posted it into a module (i.e. Module1) it worked just fine, but when I posted it directly to the Sheet, I would also get Run-time error '1004'.
So I suggest that you just create a module and post it there. I don't know why, I just know it works for me.

Hope this helps.
 
Upvote 0

Forum statistics

Threads
1,224,538
Messages
6,179,412
Members
452,912
Latest member
alicemil

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