Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Naming the current cell in Excel

I am converting macros from 123 to Excel. The macro needs
to be able to define a range name for the active cell.
Since the active cell can be on any row or in any column
when the macro is called, a fixed reference is not
acceptable. The recorded macro gives me this:
ActiveWorkbook.Names.Add Name:="here",
RefersToR1C1:="Bills!R29C1"
How can I modify this to be the current active cell?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Naming the current cell in Excel

Thomas,

Try this

ActiveWorkbook.Names.Add Name:="here", RefersToR1C1:="=Bills!RC"

But I have to ask, why bother, why not just use the cell address in the
formula?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Thomas" wrote in message
...
I am converting macros from 123 to Excel. The macro needs
to be able to define a range name for the active cell.
Since the active cell can be on any row or in any column
when the macro is called, a fixed reference is not
acceptable. The recorded macro gives me this:
ActiveWorkbook.Names.Add Name:="here",
RefersToR1C1:="Bills!R29C1"
How can I modify this to be the current active cell?



  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Naming the current cell in Excel

The complete macro is used in a sheet that lists the bills
to be paid. When activated the macro identifies the data
from the current row (Acct Name, Applicable checkbook, and
amount to be paid. It uses this info to complete the
checkbook entry, changes the date of the current line to
the schedule date for the next month, and resorts the list
of bills showing them in the anticipated order of payment.
Since the cursor can be on any bill and therefore on any
row of the bill schedule, the macro must be able to name
the active cell.

I haven't seen an example of your solution, but I'm
guessing that using RC without the number digits does this.

-----Original Message-----
Thomas,

Try this

ActiveWorkbook.Names.Add Name:="here",

RefersToR1C1:="=Bills!RC"

But I have to ask, why bother, why not just use the cell

address in the
formula?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Thomas" wrote in

message
...
I am converting macros from 123 to Excel. The macro

needs
to be able to define a range name for the active cell.
Since the active cell can be on any row or in any column
when the macro is called, a fixed reference is not
acceptable. The recorded macro gives me this:
ActiveWorkbook.Names.Add Name:="here",
RefersToR1C1:="Bills!R29C1"
How can I modify this to be the current active cell?



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Naming the current cell in Excel

Thomas,

I would have thought that the macro could refer to Activecell more easily
that keep adding a name and then referring to that.

RC without digits picks up the activecell.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

wrote in message
...
The complete macro is used in a sheet that lists the bills
to be paid. When activated the macro identifies the data
from the current row (Acct Name, Applicable checkbook, and
amount to be paid. It uses this info to complete the
checkbook entry, changes the date of the current line to
the schedule date for the next month, and resorts the list
of bills showing them in the anticipated order of payment.
Since the cursor can be on any bill and therefore on any
row of the bill schedule, the macro must be able to name
the active cell.

I haven't seen an example of your solution, but I'm
guessing that using RC without the number digits does this.

-----Original Message-----
Thomas,

Try this

ActiveWorkbook.Names.Add Name:="here",

RefersToR1C1:="=Bills!RC"

But I have to ask, why bother, why not just use the cell

address in the
formula?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Thomas" wrote in

message
...
I am converting macros from 123 to Excel. The macro

needs
to be able to define a range name for the active cell.
Since the active cell can be on any row or in any column
when the macro is called, a fixed reference is not
acceptable. The recorded macro gives me this:
ActiveWorkbook.Names.Add Name:="here",
RefersToR1C1:="Bills!R29C1"
How can I modify this to be the current active cell?



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default Naming the current cell in Excel

Hi Thomas,

I am converting macros from 123 to Excel. The macro needs
to be able to define a range name for the active cell.


Activecell.Name="Test"

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.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
Excel: Cell Naming Bulk Delete Grant Excel Worksheet Functions 1 June 19th 08 07:22 PM
Referncing the current cell name in an Excel MACRO Doug Excel Discussion (Misc queries) 1 December 8th 06 03:59 AM
How do i assign cell A1 to show the current cursor cell in Excel? OB Excel Discussion (Misc queries) 2 October 11th 06 04:02 PM
naming .xls file based on a cell in excel lsu-i-like Excel Discussion (Misc queries) 1 June 24th 05 09:44 PM
Naming Current Region Gavin[_4_] Excel Programming 3 October 14th 03 03:38 PM


All times are GMT +1. The time now is 06:33 PM.

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"