Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

name a range from the current activecell down 12 rows

0 views
Skip to first unread message

BRC

unread,
Jan 8, 2010, 2:49:28 AM1/8/10
to
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.

Benito Merino

unread,
Jan 8, 2010, 3:05:51 AM1/8/10
to

Hi BRC,

Try this code:

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

Regards,

Benito
Barcelona
Spain

Peter T

unread,
Jan 8, 2010, 3:03:35 AM1/8/10
to
ActiveCell.Resize(13, 1).Name = "myName"

MsgBox Range("myName").Name

Regards,
Peter T


"BRC" <brc1051...@yahoo.com> wrote in message
news:a22544ae-2a26-486a...@j4g2000yqe.googlegroups.com...

BRC

unread,
Jan 9, 2010, 1:01:56 PM1/9/10
to
On Jan 8, 12:05 am, Benito Merino <benimer...@gmail.com> wrote:

Thank you gentlemen for the help worked great

0 new messages