Copy range to new sheet

KGee

Well-known Member
Joined
Nov 26, 2008
Messages
526
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have a couple of ranges in one sheet that I want to copy to a new sheet using VBA. So I have range1, range2 and range3 which I want to copy to columns A, B, C in the new sheet. I can do this:

select source sheet
select range
copy range
select destination sheet
select cell A1
paste


But how do I accomplish the same thing in one line without selecting the sheets?

Sheets("Sheet1").Range.Copy .Sheets("Sheet2").Range("A1")
 

Some videos you may like

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
It looks like you have it already solved...

Sheets("Sheet1").Range("A1").Copy Sheets("Sheet2").Range("A1")

That will copy A1 from Sheet1 TO Sheet2
 

KGee

Well-known Member
Joined
Nov 26, 2008
Messages
526
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I should have mentioned that I define the three ranges in the source sheet and the number of cells being copied varies for each. So I'm not sure how to handle copying the range of cells to the clipboard and pasting each into cells A1, B1 and C1 in the destination sheet.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,143
Messages
5,599,975
Members
414,354
Latest member
Flaxarn

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