Using Dynamic Named Range in VBA

karraj

Board Regular
Joined
Mar 5, 2002
Messages
76
Hi,
I have a dynamic named range in excel named sourcedata ( created using insert->name->define). I want to use it in VBA, i tried range("sourcedata").value , I am having problems,
what is the syntax for using it in VBA
Karraj.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Make sure you are spelling it right, but it looks like the right syntax to me. What problems are you having?
 
Upvote 0
Try:

<pre>
Sheets("Sheet1").Names("mynamedrange")...etc</pre>

Put in whatever sheet you're using and the name you used for the range. That should work.
 
Upvote 0
Thanks for the replies,
With the sheet name it is working well.

In the spreadsheet, I am not able to view the dynamic ranges names in the dropdown menu in the toolbars, is there a way I can make it visible?
 
Upvote 0
You can't see the name in the drop-down to the left of the formula bar? Odd.

Also, you can use the name of the range itself to identify the sheet, e.g.,

Code:
Sheets(Range("test").Worksheet.Name).Range("test").Value
 
Upvote 0
I am not able to see ONLY the dynamic named ranges. The other named ranges can be seen in the drop down menu to the left of formula bar!
Am I missing something?
Karraj
 
Upvote 0

Forum statistics

Threads
1,214,376
Messages
6,119,174
Members
448,870
Latest member
max_pedreira

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