Assigning Named Ranges to a Variable

ThreeBullet

New Member
Joined
Sep 9, 2011
Messages
1
Folks, Please save me from lunatic asylum!

I want to position the focus onto certain specific cells, each of which I have defined as named ranges.

Effectively these are starter cells for distinct sets of calculations. I want to give the user a choice of which starter cell to use.

I want that user choice to be made using option buttons on a UserForm.

The UserForm button selection should assign a range variable to a particular Named Range, each button resetting the range variable to one particular named range.

I understand how to code selecting a particular cell, my problem is solely with assigning the named range to a variable.

All works fine until I run Sub. Then I get an Error 1004 Method 'Range' of object 'Global' failed.

I have tried everything I can for 3 days, but cannot move beyond this point.

Sorry I am new to Forum and can't figure out how to add code here to this message, but the problem should be clear from above.

Three Bullet
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Why are you selecting these ranges?

Also what do you mean by 'assign' a range variable to a named range?

Do you want to change the range referenced in the named range to the range variable?

Can you post the code?
 
Upvote 0
The code should be like this

Code:
Set Rng = Range("MyRange")

You can post code like this:

[code]
code goes here
[/code]
 
Upvote 0
ThreeBullet

Is the user actually selecting a cell then opening the userform.

Then you want them to choose a named range on the userform.
 
Upvote 0

Forum statistics

Threads
1,215,235
Messages
6,123,792
Members
449,126
Latest member
Greeshma Ravi

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