Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I control the cell reference when naming a cell in a macro
When recording a macro that creates or defines a range name for a cell, I can
programantically get to the cell I want, but the recorded macro adds a fixed reference (see example below) that I'd like to control without using a combination of numeric and string variables. I'd like to create the name using an active cell reference. Is this possible? ActiveWorkbook.Names.Add Name:="TOT", RefersToR1C1:="=PgrmPvtName!R4C38" |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I control the cell reference when naming a cell in a macro
Try
ActiveWorkbook.Names.Add Name:="TOT", RefersTo:="=" & ActiveCell.Address "Glenn" wrote: When recording a macro that creates or defines a range name for a cell, I can programantically get to the cell I want, but the recorded macro adds a fixed reference (see example below) that I'd like to control without using a combination of numeric and string variables. I'd like to create the name using an active cell reference. Is this possible? ActiveWorkbook.Names.Add Name:="TOT", RefersToR1C1:="=PgrmPvtName!R4C38" |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I control the cell reference when naming a cell in a ma
Worked great....
Thanks a whole bunch. "AKphidelt" wrote: Try ActiveWorkbook.Names.Add Name:="TOT", RefersTo:="=" & ActiveCell.Address "Glenn" wrote: When recording a macro that creates or defines a range name for a cell, I can programantically get to the cell I want, but the recorded macro adds a fixed reference (see example below) that I'd like to control without using a combination of numeric and string variables. I'd like to create the name using an active cell reference. Is this possible? ActiveWorkbook.Names.Add Name:="TOT", RefersToR1C1:="=PgrmPvtName!R4C38" |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Naming worksheets tabs from another cell reference | Excel Worksheet Functions | |||
Tab naming from a Reference cell | Excel Worksheet Functions | |||
Naming a worksheet tab from a reference cell | Excel Worksheet Functions | |||
using a cell value to control a counter inside a macro and displaying macro value | Excel Worksheet Functions | |||
Form Control for Cell Reference | Excel Programming |