Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Defining a range using defined names

Hi I have a range that that starts at
$A$2 which is named "dataStart" and ends with
$A$10 which is named "DataEnd".

I want to create a named range using the defined names, e.g
dataList refers to =dataStart:DataEnd
except that the above syntax does not work. can someone tell me the correct
syntax for this, as I don't want to use =$A$2:$A$10. The values for dataStart
and dataEnd may change which is why I do not want to hard code them.

Thanks,
Chris
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Defining a range using defined names

Chris,

try this

=OFFSET(INDIRECT(ADDRESS(ROW(DataStart),
COLUMN(DataStart))),0,0,ROW(DataEnd)-ROW(DataStart)+1,COLUMN(DataEnd)-COLUMN(DataStart)+1)


--
Hope that helps.

Vergel Adriano


"Chris Wilkinson" wrote:

Hi I have a range that that starts at
$A$2 which is named "dataStart" and ends with
$A$10 which is named "DataEnd".

I want to create a named range using the defined names, e.g
dataList refers to =dataStart:DataEnd
except that the above syntax does not work. can someone tell me the correct
syntax for this, as I don't want to use =$A$2:$A$10. The values for dataStart
and dataEnd may change which is why I do not want to hard code them.

Thanks,
Chris

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Defining a range using defined names

Sub chris()
Set rs = Range("datastart")
Set re = Range("dataEnd")
Set rt = Range(rs, re)
MsgBox (rt.Address)
rt.Name = "datalist"
End Sub

--
Gary''s Student - gsnu200722
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Defining a range using defined names

Set myRange = Range(Range("DataStart"),Range("DataEnd"))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Chris Wilkinson" wrote in
message ...
Hi I have a range that that starts at
$A$2 which is named "dataStart" and ends with
$A$10 which is named "DataEnd".

I want to create a named range using the defined names, e.g
dataList refers to =dataStart:DataEnd
except that the above syntax does not work. can someone tell me the
correct
syntax for this, as I don't want to use =$A$2:$A$10. The values for
dataStart
and dataEnd may change which is why I do not want to hard code them.

Thanks,
Chris



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Defining a range using defined names

Or
=INDIRECT(ADDRESS(ROW(datastart),COLUMN(datastart) ) & ":" &
ADDRESS(ROW(dataend),COLUMN(dataend)))
--
p45cal


"Vergel Adriano" wrote:

Chris,

try this

=OFFSET(INDIRECT(ADDRESS(ROW(DataStart),
COLUMN(DataStart))),0,0,ROW(DataEnd)-ROW(DataStart)+1,COLUMN(DataEnd)-COLUMN(DataStart)+1)


--
Hope that helps.

Vergel Adriano


"Chris Wilkinson" wrote:

Hi I have a range that that starts at
$A$2 which is named "dataStart" and ends with
$A$10 which is named "DataEnd".

I want to create a named range using the defined names, e.g
dataList refers to =dataStart:DataEnd
except that the above syntax does not work. can someone tell me the correct
syntax for this, as I don't want to use =$A$2:$A$10. The values for dataStart
and dataEnd may change which is why I do not want to hard code them.

Thanks,
Chris

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
Defined Range Names in formulas Darby Excel Discussion (Misc queries) 2 October 13th 09 04:41 PM
Help defining a user-defined function LurfysMa New Users to Excel 7 June 10th 07 07:46 AM
Rename Several Defined Range Names with Macro ExcelUser777 Excel Programming 2 January 2nd 07 01:51 PM
Listing or Changing all Defined Range Names (using VBA) Post Tenebras Lux Excel Programming 5 July 15th 06 04:24 PM
Defining worksheet specific range names Barb Reinhardt Excel Programming 2 January 17th 06 03:46 PM


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