Copy data from a range

John Wood

Board Regular
Joined
Sep 15, 2008
Messages
118
I have data in cells A1:E3. I have a range, within those cells, named 'pets' defined as cells B2:E2. I want to copy and paste that range somewhere else. How do I select that named range in VBA? I know I can't use:

Range.("pets").Copy
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
John

What makes you think you can't use something like that?

The only problem I can see is the . after Range.:)
 
Upvote 0
I actually got that problem solved AFTER I posted my question. I should have tried harder:(.

Now my problem is trying to use a validation list, that contains the named ranges of the data I want, to copy and paste another cell.

Private Sub CommandButton1_Click()
'Dim source As Range
Set source = Range("R32").Value
source.Copy
Range("a32").PasteSpecial
End Sub

The validation list is in cell R32 but all this does is copy the word that appears in the list and paste it to A32. I want to used that validation list value AS the range.

Any ideas? I think I'm close but I'm tired, it's been a long day....
 
Upvote 0

Forum statistics

Threads
1,225,563
Messages
6,185,708
Members
453,316
Latest member
mani_mech031

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