Named Range / use of Indirect?

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,484
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

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

Yard

Well-known Member
Joined
Nov 5, 2008
Messages
1,929
Do you mean

Code:
Range("A1").copy
Range("Testme").Cells(2,1).PasteSpecial xlPasteValues
 
Last edited:
Upvote 0

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,484
Thanks Yard, but the Value in A1 is CHANGABLE (a Variable, but always a registered Named Range)
 
Upvote 0

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,484
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

Jon von der Heyden

MrExcel MVP, Moderator
Joined
Apr 6, 2004
Messages
10,894
Office Version
  1. 365
Platform
  1. Windows
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

Jon von der Heyden

MrExcel MVP, Moderator
Joined
Apr 6, 2004
Messages
10,894
Office Version
  1. 365
Platform
  1. Windows
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

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,484
Jon - YOU WERE RIGHT ON !!
Thanks,
I need to study this to better understand why
I couldn't do this.
Jim
 
Upvote 0

Yard

Well-known Member
Joined
Nov 5, 2008
Messages
1,929
I think (hope) Jon's got it, because otherwise I'm even more confused.

:)
 
Upvote 0

Forum statistics

Threads
1,191,077
Messages
5,984,503
Members
439,894
Latest member
Amba1006

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