Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Excel macro to insert names for ranges, not always the same size..

I need an Exel macro to insert names for ranges, not always the same size.
They always start in Colunn A and end in Column U.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Excel macro to insert names for ranges, not always the same size..

ActiveWorkbook.Names.Add Name:="MyRange1", RefersToR1C1:= _
"=Sheet1!R2C1:R2C21"

will insert the name: MyRange1
and will refer to the cells A2:U2


"Ocicat" wrote:

I need an Exel macro to insert names for ranges, not always the same size.
They always start in Colunn A and end in Column U.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Excel macro to insert names for ranges, not always the same si

You could also try:
Dim myRange as Range

set myRange = Workbooks(1).Sheets(1).Range("A1:U1")
myRange.Name = "MyRange"

"gocush" wrote:

ActiveWorkbook.Names.Add Name:="MyRange1", RefersToR1C1:= _
"=Sheet1!R2C1:R2C21"

will insert the name: MyRange1
and will refer to the cells A2:U2


"Ocicat" wrote:

I need an Exel macro to insert names for ranges, not always the same size.
They always start in Colunn A and end in Column U.

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
How do I insert a ' } ' into excel so that I can adjust its size? deepstevec Excel Discussion (Misc queries) 0 August 17th 07 02:12 AM
How do I insert a ' } ' into excel so that I can adjust its size? bj Excel Discussion (Misc queries) 0 August 17th 07 02:04 AM
How do I insert a ' } ' into excel so that I can adjust its size? Mike H Excel Discussion (Misc queries) 0 August 17th 07 01:49 AM
How do I segment a column of data into size ranges in Excel? Motown Mick Excel Discussion (Misc queries) 15 August 28th 06 11:04 PM
I need a macro that will insert names in an excel worksheet, the . Ocicat Excel Programming 1 November 16th 04 06:04 PM


All times are GMT +1. The time now is 05:58 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"