Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default Names.Add - Range Syntax Issue

I have a variable that holds a number.
I have a start point for a named range that needs to go out the number of
columns based on that variable. The following works wonderfully for vertical
situations but I need that variable €śmovs€ť to denote the column not row.

movs = Sheets("WIP2").Range("I4").Value
ActiveWorkbook.Names.Add Name:="TEST", RefersTo:=Range("A1:A" & movs)

Spastic morning,
Arturo

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Names.Add - Range Syntax Issue

ActiveWorkbook.Names.Add Name:="TEST", RefersTo:=Columns(movs)

"Arturo" wrote:

I have a variable that holds a number.
I have a start point for a named range that needs to go out the number of
columns based on that variable. The following works wonderfully for vertical
situations but I need that variable €śmovs€ť to denote the column not row.

movs = Sheets("WIP2").Range("I4").Value
ActiveWorkbook.Names.Add Name:="TEST", RefersTo:=Range("A1:A" & movs)

Spastic morning,
Arturo

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Names.Add - Range Syntax Issue

ActiveWorkbook.Names.Add Name:="TEST", RefersTo:=Range("A1",Cells(
movs,100))


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Arturo" wrote in message
...
I have a variable that holds a number.
I have a start point for a named range that needs to go out the number of
columns based on that variable. The following works wonderfully for

vertical
situations but I need that variable "movs" to denote the column not row.

movs = Sheets("WIP2").Range("I4").Value
ActiveWorkbook.Names.Add Name:="TEST", RefersTo:=Range("A1:A" & movs)

Spastic morning,
Arturo



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default Names.Add - Range Syntax Issue

The range's start point is A1 and needs to size to the column associated with
movs in the same row.
I still do not see How to incorporate movs

ActiveWorkbook.Names.Add Name:="TEST", RefersTo:=Range("A1:" & Columns(movs)
& "1")

Something is off with the R1C1 notation

Arturo


"Toppers" wrote:

ActiveWorkbook.Names.Add Name:="TEST", RefersTo:=Columns(movs)

"Arturo" wrote:

I have a variable that holds a number.
I have a start point for a named range that needs to go out the number of
columns based on that variable. The following works wonderfully for vertical
situations but I need that variable €śmovs€ť to denote the column not row.

movs = Sheets("WIP2").Range("I4").Value
ActiveWorkbook.Names.Add Name:="TEST", RefersTo:=Range("A1:A" & movs)

Spastic morning,
Arturo

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default Names.Add - Range Syntax Issue

Thank you both!

ActiveWorkbook.Names.Add Name:="TEST", RefersTo:=Range("A1", Cells(1, movs))

"Bob Phillips" wrote:

ActiveWorkbook.Names.Add Name:="TEST", RefersTo:=Range("A1",Cells(
movs,100))


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Arturo" wrote in message
...
I have a variable that holds a number.
I have a start point for a named range that needs to go out the number of
columns based on that variable. The following works wonderfully for

vertical
situations but I need that variable "movs" to denote the column not row.

movs = Sheets("WIP2").Range("I4").Value
ActiveWorkbook.Names.Add Name:="TEST", RefersTo:=Range("A1:A" & movs)

Spastic morning,
Arturo




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
converting email address names in a range of cells to real names John Excel Worksheet Functions 1 May 19th 10 03:44 PM
help with the syntax for using range name in a formula? BRC[_2_] Excel Discussion (Misc queries) 2 January 9th 10 06:16 PM
Defined Names issue Nick Excel Discussion (Misc queries) 0 July 23rd 08 08:35 PM
COPYING FORMULA CONTAINING NAMES/RELATIVE RANGE NAMES Bricol Excel Discussion (Misc queries) 0 July 8th 08 03:54 PM
VBA: syntax to review macro names in a file? [email protected] Excel Discussion (Misc queries) 2 September 7th 05 10:01 PM


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