Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default name a range from the current activecell down 12 rows

Hi,
I know this is probably very simple but I can't find the code i need
and when I try to record as a macro i get hard coded addesses (c7.c19)
rather then just something like "xldown 12." and since the starting
address varies, the hardcoded address don't help. I want to select the
activecell and 12 or 13 down and then give that range a name. Thk in
advance for any help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default name a range from the current activecell down 12 rows

ActiveCell.Resize(13, 1).Name = "myName"

MsgBox Range("myName").Name

Regards,
Peter T


"BRC" wrote in message
...
Hi,
I know this is probably very simple but I can't find the code i need
and when I try to record as a macro i get hard coded addesses (c7.c19)
rather then just something like "xldown 12." and since the starting
address varies, the hardcoded address don't help. I want to select the
activecell and 12 or 13 down and then give that range a name. Thk in
advance for any help.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default name a range from the current activecell down 12 rows

On 8 ene, 08:49, BRC wrote:
Hi,
I know this is probably very simple but I can't find the code i need
and when I try to record as a macro i get hard coded addesses (c7.c19)
rather then just something like "xldown 12." *and since the starting
address varies, the hardcoded address don't help. I want to select the
activecell and 12 or 13 *down and then give that range a name. *Thk in
advance for any help.


Hi BRC,

Try this code:

ActiveWorkbook.Names.Add Name:="namerange", RefersTo:=ActiveCell.Resize
(12, 1)

Regards,

Benito
Barcelona
Spain
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default name a range from the current activecell down 12 rows

On Jan 8, 12:05*am, Benito Merino wrote:
On 8 ene, wrote:

Hi,
I know this is probably very simple but I can't find the code i need
and when I try to record as a macro i get hard coded addesses (c7.c19)
rather then just something like "xldown 12." *and since the starting
address varies, the hardcoded address don't help. I want to select the
activecell and 12 or 13 *down and then give that range a name. *Thk in
advance for any help.


HiBRC,

Try this code:

ActiveWorkbook.Names.Add Name:="namerange", RefersTo:=ActiveCell.Resize
(12, 1)

Regards,

Benito
Barcelona
Spain


Thank you gentlemen for the help worked great
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
Rows outside of current range being saved as CSV CEG Excel Programming 2 August 27th 07 09:46 PM
How to make last cell in current selection the activecell Snowsride Excel Programming 1 September 5th 06 02:30 PM
Identify Current Row for ActiveCell COL H Excel Programming 6 April 29th 05 10:17 PM
Selecting a range composed of current region + 2 rows Bruce Roberson[_5_] Excel Programming 2 October 27th 04 03:00 PM
How do I reference Current Cell when cell isn't the Activecell VBA2VBZGuy Excel Programming 2 December 15th 03 09:27 PM


All times are GMT +1. The time now is 04:42 PM.

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"