Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default accessing named range

if I have an excel named range. Lets say my_range. and it is the range of
$B$11:$B$51
How can I get the value of the first item?
lets say
B11 = AAA
B12 = BBB
etc....


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default accessing named range

=INDEX(my_range,1)

--
HTH

Bob

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

"greg" wrote in message
...
if I have an excel named range. Lets say my_range. and it is the range
of
$B$11:$B$51
How can I get the value of the first item?
lets say
B11 = AAA
B12 = BBB
etc....




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default accessing named range

thanks,
but not from a cell. but inside of vba


"Bob Phillips" wrote in message
...
=INDEX(my_range,1)

--
HTH

Bob

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

addy)

"greg" wrote in message
...
if I have an excel named range. Lets say my_range. and it is the range
of
$B$11:$B$51
How can I get the value of the first item?
lets say
B11 = AAA
B12 = BBB
etc....






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default accessing named range

Range("my_range").Cells(1,1)

--
---
HTH

Bob

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



"greg" wrote in message
...
thanks,
but not from a cell. but inside of vba


"Bob Phillips" wrote in message
...
=INDEX(my_range,1)

--
HTH

Bob

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

addy)

"greg" wrote in message
...
if I have an excel named range. Lets say my_range. and it is the
range
of
$B$11:$B$51
How can I get the value of the first item?
lets say
B11 = AAA
B12 = BBB
etc....








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 200
Default accessing named range

Bob Phillips wrote:
Range("my_range").Cells(1,1)

Slightly more efficiently

Range("my_range")(1,1)

or, for the vertical range proposed

Range("my_range")(1)

Alan Beban


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default accessing named range


don't know what's more efficient, but just another way

Range("my_range").Range("A1")
--


Gary


"Alan Beban" <unavailable wrote in message
...
Bob Phillips wrote:
Range("my_range").Cells(1,1)

Slightly more efficiently

Range("my_range")(1,1)

or, for the vertical range proposed

Range("my_range")(1)

Alan Beban



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default accessing named range

Yeah, but ugly, ugly, and not worth any performance gain, so I will not be
using it.

--
HTH

Bob

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

"Alan Beban" <unavailable wrote in message
...
Bob Phillips wrote:
Range("my_range").Cells(1,1)

Slightly more efficiently

Range("my_range")(1,1)

or, for the vertical range proposed

Range("my_range")(1)

Alan Beban



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default accessing named range

msgbox worksheets("Sheet999").range("my_Range").cells(1). value



greg wrote:

if I have an excel named range. Lets say my_range. and it is the range of
$B$11:$B$51
How can I get the value of the first item?
lets say
B11 = AAA
B12 = BBB
etc....


--

Dave Peterson
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 200
Default accessing named range

Or slightly more efficiently

msgbox Worksheets("Sheet999").Range("my_Range")(1).value

Alan Beban

Dave Peterson wrote:
msgbox worksheets("Sheet999").range("my_Range").cells(1). value



greg wrote:
if I have an excel named range. Lets say my_range. and it is the range of
$B$11:$B$51
How can I get the value of the first item?
lets say
B11 = AAA
B12 = BBB
etc....


  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default accessing named range

I see this:
Dim rng As Range
Set rng = Worksheets("Sheet1").Range("my_range")
then rng has lots of things:
Value2
formula
but it does not seem like i can use them.
any help?




"greg" wrote in message
...
if I have an excel named range. Lets say my_range. and it is the range

of
$B$11:$B$51
How can I get the value of the first item?
lets say
B11 = AAA
B12 = BBB
etc....






  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default accessing named range

thanks all for the help
I was thinking maybe i needed to use vlookup.


"greg" wrote in message
...
if I have an excel named range. Lets say my_range. and it is the range

of
$B$11:$B$51
How can I get the value of the first item?
lets say
B11 = AAA
B12 = BBB
etc....




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
inserting a named range into new cells based on a named cell Peter S. Excel Discussion (Misc queries) 1 June 4th 06 03:53 AM
Named Ranges - accessing a cell mojoweiss Excel Discussion (Misc queries) 1 September 1st 05 04:20 PM
If any cell in named range = 8 then shade named range JJ[_8_] Excel Programming 3 August 26th 05 11:09 PM
Accessing named ranges in Excel from VBA Basz Excel Discussion (Misc queries) 1 August 10th 05 03:21 PM
Accessing Named Ranges Michael Monteiro Excel Programming 1 August 27th 03 05:29 PM


All times are GMT +1. The time now is 01:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"