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

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Barrie Davidson

MrExcel MVP
Joined
Feb 10, 2002
Messages
2,330
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,
 

Maurizio

Well-known Member
Joined
Oct 15, 2002
Messages
682
Office Version
  1. 2007
Platform
  1. Windows
Ok, but is it possible copy ONLY VALUES?
 

Barrie Davidson

MrExcel MVP
Joined
Feb 10, 2002
Messages
2,330
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,
 

Forum statistics

Threads
1,143,640
Messages
5,719,985
Members
422,256
Latest member
downeybm

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
Top