adding a line at the end of a macro to name the cell

  • Thread starter Thread starter yippy
  • Start date Start date
Y

yippy

Hi all,

I have a macro that i want to edit. At the end of my current macro,
the cursor is pointed to a specific cell, but it varies in location
everytime. What I would like to do is to add a line to my currrent
macro and name the active cell that it's pointing to. I have something
like ActiveWorkbook.Names.Add Name:="USAR",
RefersToR1C1:="=AR10!R175C14" currently, but the problem is, this
syntax has a specific reference to the cell location. I want to name
the active cell w/o referencing it's location.

Any help will be greatly appreciated!

Thanks,
Yippy
 
Yippy,

Try something like

ActiveWorkbook.Names.Add Name:="USAR", _
RefersTo:=ActiveCell

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Or even:

activecell.name = "USAR"



yippy < said:
Hi all,

I have a macro that i want to edit. At the end of my current macro,
the cursor is pointed to a specific cell, but it varies in location
everytime. What I would like to do is to add a line to my currrent
macro and name the active cell that it's pointing to. I have something
like ActiveWorkbook.Names.Add Name:="USAR",
RefersToR1C1:="=AR10!R175C14" currently, but the problem is, this
syntax has a specific reference to the cell location. I want to name
the active cell w/o referencing it's location.

Any help will be greatly appreciated!

Thanks,
Yippy
 
Back
Top