copy range from one worksheet to another vba

ratnesh darne

New Member
Joined
Jun 15, 2011
Messages
4
I want to copy range from one worksheet to another with one reference.

like if range is A1:AU5 and have reference value in cell AW1 or AW1:AW5, How can i copy the same range by same reference to another worksheet?
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Maybe like this

Code:
Sub a()
Range("A1:AU5").Copy Destination:=Range(Range("AW1").Value)
End Sub
 
Upvote 0
Hi Try this one

Sub RangeTransfer()

Set ws = Application.Worksheets(1)
Set wsn = Application.Worksheets(2)

With ws
.Range("A1:AU5").Copy Destination:=wsn.Range("A1")
.Range("AW1:AW5").Copy Destination:=wsn.Range("AW1")
End With

End Sub

This assumes that you are transfering from worksheet name sheet1 to sheet2 (Name your sheets accordingly)

Hope it works
 
Last edited:
Upvote 0
Hi Try this one

Sub RangeTransfer()
Set ws = Application.Worksheets(1)
Set wsn = Application.Worksheets(2)
With ws
.Range("A1:AU5").Copy Destination:=wsn.Range("A1")
.Range("AW1:AW5").Copy Destination:=wsn.Range("AW1")
End with
End Sub

Hope it works
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,799
Members
452,943
Latest member
Newbie4296

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