ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   cell name - macro (https://www.excelbanter.com/excel-programming/366195-cell-name-macro.html)

ALEX

cell name - macro
 
Hello,

I wrote this macro to name a cell:

caddress = ActiveCell.Address
cursheetname = ActiveSheet.Name
ActiveSheet.Names.Add Name:="LAST", RefersToR1C1:="=cursheetname!caddress"

it does not work. anybody can help ?
thanks.

==
this also does not work:

ActiveSheet.Names.Add Name:="LAST",
RefersToR1C1:="=cursheetname!address(ReferenceStyl e:=xlR1C1)"



Don Guillett

cell name - macro
 
try this simple line

activecell.name="Last"

--
Don Guillett
SalesAid Software

"alex" wrote in message
...
Hello,

I wrote this macro to name a cell:

caddress = ActiveCell.Address
cursheetname = ActiveSheet.Name
ActiveSheet.Names.Add Name:="LAST", RefersToR1C1:="=cursheetname!caddress"

it does not work. anybody can help ?
thanks.

==
this also does not work:

ActiveSheet.Names.Add Name:="LAST",
RefersToR1C1:="=cursheetname!address(ReferenceStyl e:=xlR1C1)"






All times are GMT +1. The time now is 03:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com