Named Range / use of Indirect?

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,486
In cell A1 I have the text Testme

Testme is a Named Range
with RefersTo set to:
=Sheet1!$D$3:$D$5

In VBA - How do I

Range("A1").copy Range("D4").PasteSpecial xlPasteValues

And D4:D6 will show
123
456
789

This thing is beating me up -- Indirect is likely involved, but,,,
TIA
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Do you mean

Code:
Range("A1").copy
Range("Testme").Cells(2,1).PasteSpecial xlPasteValues
 
Last edited:
Upvote 0
Thanks Yard, but the Value in A1 is CHANGABLE (a Variable, but always a registered Named Range)
 
Upvote 0
In VBA - How do I
Correction - My first note should have been:

Range("A1").copy Range("K4").PasteSpecial xlPasteValues

And K4:K6 will show
123
456
789

Sorry for My Confusion!!
 
Upvote 0
Hi Jim

I'm confused :confused:

You have said that A1 contains Testme, yet when you copy and paste; it pastes 123?

If you want to use the value in A1 to direct you to a named range in VBA (as a paste destination), then perhaps:

Range(Range("A1").Value).PasteSpecial xlValues
 
Upvote 0
I think I understand.

A1 has text Testme

Tesme range refers to D3:D5 and it is populated with:
123
456
789

And you want to copy this (based on named range name entered in A1) to K4.

Right?

Code:
Range(Range("A1").Value).Copy
         Range("K4").PasteSpecial xlValues
 
Upvote 0
Jon - YOU WERE RIGHT ON !!
Thanks,
I need to study this to better understand why
I couldn't do this.
Jim
 
Upvote 0
I think (hope) Jon's got it, because otherwise I'm even more confused.

:)
 
Upvote 0

Forum statistics

Threads
1,214,626
Messages
6,120,602
Members
448,974
Latest member
ChristineC

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