Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using Activecell.Address when defining name

Hi,

When using
ActiveWorkbook.Names.Add Name:=sNameString,
RefersTo:=ActiveCell.AddressLocal

To put the name stored in sNameString to the active cell, it does not
work because ActiveCell.Addreslocal returns "$B$2" rather than $B$2.
What is the easiest way around this?

Thanks


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Using Activecell.Address when defining name

Hi Hardy,

Try:

ActiveWorkbook.Names.Add Name:=sNameString, _
RefersTo:=ActiveCell


---
Regards,
Norman



"Hardy " wrote in message
...
Hi,

When using
ActiveWorkbook.Names.Add Name:=sNameString,
RefersTo:=ActiveCell.AddressLocal

To put the name stored in sNameString to the active cell, it does not
work because ActiveCell.Addreslocal returns "$B$2" rather than $B$2.
What is the easiest way around this?

Thanks


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Using Activecell.Address when defining name


Use Address instead of Addresslocal

ActiveWorkbook.Names.Add Name:=sNameString, _
RefersTo:="=" & ActiveCell.Address

VBA/Excel should make the necessary adjustments.

or

ActiveCell.Name = sNameString

--
Regards,
Tom Ogilvy


"Hardy " wrote in message
...
Hi,

When using
ActiveWorkbook.Names.Add Name:=sNameString,
RefersTo:=ActiveCell.AddressLocal

To put the name stored in sNameString to the active cell, it does not
work because ActiveCell.Addreslocal returns "$B$2" rather than $B$2.
What is the easiest way around this?

Thanks


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Using Activecell.Address when defining name

the first should be:

ActiveWorkbook.Names.Add Name:=sNameString, _
RefersTo:="=" & ActiveCell.Address(external:=True)

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...

Use Address instead of Addresslocal

ActiveWorkbook.Names.Add Name:=sNameString, _
RefersTo:="=" & ActiveCell.Address

VBA/Excel should make the necessary adjustments.

or

ActiveCell.Name = sNameString

--
Regards,
Tom Ogilvy


"Hardy " wrote in message
...
Hi,

When using
ActiveWorkbook.Names.Add Name:=sNameString,
RefersTo:=ActiveCell.AddressLocal

To put the name stored in sNameString to the active cell, it does not
work because ActiveCell.Addreslocal returns "$B$2" rather than $B$2.
What is the easiest way around this?

Thanks


---
Message posted from http://www.ExcelForum.com/





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using Activecell.Address when defining name

Thanks Norma and Tom!
Both work fin

--
Message posted from http://www.ExcelForum.com

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
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
Defining an Activecell Ant Excel Discussion (Misc queries) 6 October 3rd 05 05:32 PM
Activecell address Patty2005[_4_] Excel Programming 2 August 7th 04 03:58 AM
ActiveCell.Address Todd Huttenstine Excel Programming 3 July 27th 04 04:45 PM
LINKING Address cells from an EXCEL spreadsheet to fill MapQuest Address Info Duane S. Meyer Excel Programming 0 August 30th 03 12:16 AM


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

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

About Us

"It's about Microsoft Excel"