Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Insert named range problem

I want to be able to insert a named range using an A1 reference based on the
activecell using VBA. Based on Help, I tried the following code:

With ActiveWorkbook
.Names.Add Name:="Hold1", RefersTo:=RefersToLocal
End With
It does insert a name, but the range it refers to is #N/A. Is there a way
to do this so that it actually refers to the cell (for example, =B45)?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Insert named range problem

Hi FinChase,

Try:

RefersTo := ActiveCell

Or for any other cell just use, e.g.:
RefersTo := [B45]

-Erik


--
This posting is provided "AS IS" with no warranties, and confers no rights.

"FinChase" wrote in message
...
I want to be able to insert a named range using an A1 reference based on
the
activecell using VBA. Based on Help, I tried the following code:

With ActiveWorkbook
.Names.Add Name:="Hold1", RefersTo:=RefersToLocal
End With
It does insert a name, but the range it refers to is #N/A. Is there a way
to do this so that it actually refers to the cell (for example, =B45)?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Insert named range problem

RefersToLocal is another property thatyiu could use rather than Refersto, if
the formula is in local language.

You need to rfefrence the range, but it can be shortcut with

Activecell.Name:="Hold1"

--

HTH

RP
(remove nothere from the email address if mailing direct)


"FinChase" wrote in message
...
I want to be able to insert a named range using an A1 reference based on

the
activecell using VBA. Based on Help, I tried the following code:

With ActiveWorkbook
.Names.Add Name:="Hold1", RefersTo:=RefersToLocal
End With
It does insert a name, but the range it refers to is #N/A. Is there a way
to do this so that it actually refers to the cell (for example, =B45)?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Insert named range problem

it aint that simple...

ReferstoLocal argument of the Names.Add method
does NOT accept local formulas...

it accepts local FUNCTIONS but needs USenglish
separators and references.




--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam

Bob Phillips wrote in message
:

RefersToLocal is another property thatyiu could use rather than
Refersto, if the formula is in local language.

You need to rfefrence the range, but it can be shortcut with

Activecell.Name:="Hold1"


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Insert named range problem

I think you are missing the point, it is not a value to the RefersTo
property as the OP was using it, it was being used as an (undefined)
variable. He doesn't want RefersToLocal AFAICS, he got confused by the help.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"keepITcool" wrote in message
...
it aint that simple...

ReferstoLocal argument of the Names.Add method
does NOT accept local formulas...

it accepts local FUNCTIONS but needs USenglish
separators and references.




--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam

Bob Phillips wrote in message
:

RefersToLocal is another property thatyiu could use rather than
Refersto, if the formula is in local language.

You need to rfefrence the range, but it can be shortcut with

Activecell.Name:="Hold1"






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Insert named range problem

true

my comment was more a NOTE to you <g
stay away from the RefersTolocal/ReferstoR1c1Local
arguments of the names.add method.

they were programmed by a xenophobe.





--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam

Bob Phillips wrote in message
:

I think you are missing the point, it is not a value to the RefersTo
property as the OP was using it, it was being used as an (undefined)
variable. He doesn't want RefersToLocal AFAICS, he got confused by the
help.


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Insert named range problem

Jurgen,

I can assure you that I do stay well away from it <vbg.

One of the 'advantages' of using a version of MS products that is almost US
is that internatiolisation issues are rarely a problem, and when they are I
use my continental colleagues to sort it for me :-).

Bob

"keepITcool" wrote in message
...
true

my comment was more a NOTE to you <g
stay away from the RefersTolocal/ReferstoR1c1Local
arguments of the names.add method.

they were programmed by a xenophobe.





--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam

Bob Phillips wrote in message
:

I think you are missing the point, it is not a value to the RefersTo
property as the OP was using it, it was being used as an (undefined)
variable. He doesn't want RefersToLocal AFAICS, he got confused by the
help.




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Insert named range problem

Hi
I just would consider this porperty buggy and nearly useless :-)

--
Regards
Frank Kabel
Frankfurt, Germany


keepITcool wrote:
it aint that simple...

ReferstoLocal argument of the Names.Add method
does NOT accept local formulas...

it accepts local FUNCTIONS but needs USenglish
separators and references.




www.XLsupport.com | keepITcool chello nl | amsterdam


Bob Phillips wrote in message
:

RefersToLocal is another property thatyiu could use rather than
Refersto, if the formula is in local language.

You need to rfefrence the range, but it can be shortcut with

Activecell.Name:="Hold1"

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with link to named range Victor Delta[_2_] Excel Discussion (Misc queries) 0 August 17th 09 02:49 PM
Insert Named Range Into a Cell Tondos Excel Worksheet Functions 2 February 27th 09 06:29 PM
Series Named Range Problem Arturo Charts and Charting in Excel 1 July 3rd 07 09:31 PM
Problem with Dynamic Named Range Philip Excel Worksheet Functions 1 December 7th 06 04:09 PM
external named range problem JKC Excel Discussion (Misc queries) 0 March 7th 06 05:23 PM


All times are GMT +1. The time now is 06:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"