Run-time error 1004 Select method of Range class failed

Joined
Jul 28, 2010
Messages
10
I have what I thought was a simple macro, to transfer a range of cells from one worksheet to the next available row on another worksheet:

Private Sub CommandButton2_Click()
' Save & Print button

Sheets("TOOL").Range("BA132:EX132").Copy
Sheets("Data").Activate
Range("A65536").Select
ActiveCell.End(xlDown).Offset(1).Select
ActiveSheet.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Sheets("TOOL").Activate
Range("A26").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub

When I click on the command button, I get the message
Run-time error '1004':
Select method of Range class failed.
When I click on Debug, it highlights the line:
Range("A65536").Select
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Try this

Code:
Private Sub CommandButton2_Click()
' Save & Print button

Sheets("TOOL").Range("BA132:EX132").Copy
Sheets("Data").Range("A65536").End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub
 
Upvote 0

Forum statistics

Threads
1,216,089
Messages
6,128,750
Members
449,466
Latest member
Peter Juhnke

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