Can this be done without selecting the sheet ?

tim963

Board Regular
Joined
Aug 20, 2002
Messages
58
Can this be done without selecting sheet 2? Thanks
Sub Macro1()
Range("A2:A5").Select
Selection.Copy
Sheets("Sheet2").Select
Range("A65536").Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
End Sub
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
On 2002-10-24 11:45, tim963 wrote:
Can this be done without selecting sheet 2? Thanks
Sub Macro1()
Range("A2:A5").Select
Selection.Copy
Sheets("Sheet2").Select
Range("A65536").Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
End Sub

Yes, I've also taken the liberty of eliminating your "Select" statements as this slows down your macro. Here you go:

<PRE>
Sub Macro1()
Range("A2:A5").Copy Destination:=Sheets("Sheet2"). _
Range("A65536").End(xlUp).Offset(1, 0)
End Sub

</PRE>

Best regards,
 
Upvote 0
On 2002-10-24 12:52, maurizio.rota wrote:
Ok, but is it possible copy ONLY VALUES?

Yup,

<PRE>
Sub Macro1()
Range("A2:A5").Copy
Sheets("Sheet2").Range("A65536").End(xlUp).Offset(1, 0).PasteSpecial _
Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
End Sub

</PRE>

Regards,
 
Upvote 0

Forum statistics

Threads
1,213,482
Messages
6,113,915
Members
448,532
Latest member
9Kimo3

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