Defining worksheet specific range names

B

Barb Reinhardt

I have the following in a macro

ActiveWorkbook.Names.Add Name:=rangename, RefersToR1C1:=seriesrange

This works to define workbook names. Is it possible to define a worksheet
specific name? I have the sheet name defined as "sht" and am wondering what
I need to change if it can be done.

Thanks in advance,
Barb Reinhardt
 
G

galimi

Barb,

I believe to specify a local sheet name, you simply have to preface the
rangename string with the sheet name and an exclamation point.
 
B

Bob Phillips

Like so

worksheets("Sheet1").names.add name:="Jim",refersto:=range("A1:B1")

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 

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

Top