Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Range Selection

Hi Monsoor,

Change Cells(6, i) to Cells(49,i)

I omitted to amend my test!

---
Regards,
Norman

"Norman Jones" wrote in message news:...
Hi Monsoor,

Try:

Sub Test()
Dim i As Long

For i = 1 To 49
Range(Cells(1, i), Cells(6, i)).Name = "Charts" & i
Next i

End Sub

---
Regards,
Norman

"Monsoor" wrote in message
...
Hi All,

What I want to do is simple but can't figure it out. I
have a range as follow:

Dim Rng as Range
Set Rng = Range ("A2:A6")

I want to name this range
Rng.name = "Chart1"

What I want to do is to name the same number of cells in
columns B to AW in the same rows by adding the column
number to the name like above. So range("B2:B6")would be
named as "Chart2". I can do this by:

rng.offset(0,1).name = "Chart2"

This means I will have to do it 49 times! There must be an
easier way of getting the same result. Help is
appreciated. Thanks in advance.

Regards

Monsoor





  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Range Selection

Hi Monsoor:

Please totally disregard my last message.
My first message is correct!!

---
Regards,
Norman

"Norman Jones" wrote in message
...
Hi Monsoor,

Change Cells(6, i) to Cells(49,i)

I omitted to amend my test!

---
Regards,
Norman

"Norman Jones" wrote in message news:...
Hi Monsoor,

Try:

Sub Test()
Dim i As Long

For i = 1 To 49
Range(Cells(1, i), Cells(6, i)).Name = "Charts" & i
Next i

End Sub

---
Regards,
Norman

"Monsoor" wrote in message
...
Hi All,

What I want to do is simple but can't figure it out. I
have a range as follow:

Dim Rng as Range
Set Rng = Range ("A2:A6")

I want to name this range
Rng.name = "Chart1"

What I want to do is to name the same number of cells in
columns B to AW in the same rows by adding the column
number to the name like above. So range("B2:B6")would be
named as "Chart2". I can do this by:

rng.offset(0,1).name = "Chart2"

This means I will have to do it 49 times! There must be an
easier way of getting the same result. Help is
appreciated. Thanks in advance.

Regards

Monsoor







  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Range Selection

Hi Norman,

This works fine. Thanks for your help. Saved me from lot
of typings and a very long macro. Thanks.

Regards

Monsoor

-----Original Message-----
Hi Monsoor:

Please totally disregard my last message.
My first message is correct!!

---
Regards,
Norman

"Norman Jones" wrote in

message
...
Hi Monsoor,

Change Cells(6, i) to Cells(49,i)

I omitted to amend my test!

---
Regards,
Norman

"Norman Jones" wrote

in message news:...
Hi Monsoor,

Try:

Sub Test()
Dim i As Long

For i = 1 To 49
Range(Cells(1, i), Cells(6, i)).Name = "Charts" &

i
Next i

End Sub

---
Regards,
Norman

"Monsoor" wrote

in message
...
Hi All,

What I want to do is simple but can't figure it

out. I
have a range as follow:

Dim Rng as Range
Set Rng = Range ("A2:A6")

I want to name this range
Rng.name = "Chart1"

What I want to do is to name the same number of

cells in
columns B to AW in the same rows by adding the

column
number to the name like above. So range("B2:B6")

would be
named as "Chart2". I can do this by:

rng.offset(0,1).name = "Chart2"

This means I will have to do it 49 times! There

must be an
easier way of getting the same result. Help is
appreciated. Thanks in advance.

Regards

Monsoor






.

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
Narrow Range based on Selection in Another Range David Excel Discussion (Misc queries) 3 July 1st 07 05:12 PM
Identifying a selection of a selection of a range swimfast Excel Worksheet Functions 1 March 1st 07 02:51 AM
Range Selection Monsoor Excel Programming 1 May 10th 04 10:34 AM
Creating range name for a range selection Mervyn Thomas Excel Programming 1 January 26th 04 05:18 PM
range selection douvid Excel Programming 2 December 14th 03 05:52 PM


All times are GMT +1. The time now is 09:40 AM.

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"