View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default First and Last cell of a named range

Steven,
If your named range is named "MyRange" then this is one way...
'-------------------------------
Sub GetNamedRangeValues()
Dim x As Long
Dim y As Variant

x = Range("MyRange").Count
y = "Last cell value is " & Range("MyRange")(x).Value
MsgBox y

y = Range("MyRange")(1).Value
MsgBox "First cell value is " & y
End Sub
'-----------------------------------

Regards,
Jim Cone
San Francisco, CA

"Steven K" wrote in message ...
Hello,
How do you determine what the first and last cell of a named range and get
its value? Can you use the offset function with this?
Thanks in advance,
Steven