Macros to create named range

Gaurjaya

New Member
Joined
Sep 7, 2015
Messages
8
Hi,

I want to create named range from selection (left column). Can any one help me with how to write a macros for it.

Thanks in advance
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Code:
[color=darkblue]Sub[/color] CreateNamedRange()
    ActiveWorkbook.Names.Add Name:="MyName", RefersTo:=Selection
[color=darkblue]End[/color] [color=darkblue]Sub[/color]
 
Upvote 0
Hi, Can you explain this. I have an excel sheet where my range to be named is C2:C19, and I want to name these individual cells as the names written in range B2:B19. Can you help me in writting a VBA code for this
 
Upvote 0

Forum statistics

Threads
1,216,028
Messages
6,128,395
Members
449,446
Latest member
CodeCybear

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