Using VB to create range name

  • Thread starter Thread starter Meme
  • Start date Start date
M

Meme

Hi,
I'm trying to create a range name in my VB code, and I
have no idea how to program this . Any help is
appreciated.
Thanks
Meme
 
Meme,

The simplest way is to use code similar to the following:

Range("A1:A10").Name = "TheName"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Hi Mem

Names.Add Name:="NewName", _
RefersToR1C1:="=Sheet1!R1C1:R100C1"

this adds a new range name called NewName which refers to Sheet1 A1:A100

Hope this help
Cheers
JulieD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top