Thread: Range reference
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Vergel Adriano Vergel Adriano is offline
external usenet poster
 
Posts: 857
Default Range reference

Arne,

try it this way:

ThisWorkbook.Names.Add Name:="FactorCorrRange", _
RefersTo:="=$i$1:$j$5", Visible:=True
Var = Range("FactorCorrRange").Cells(1, 1).Value


--
Hope that helps.

Vergel Adriano


"Arne Hegefors" wrote:

Hi! In my macro I have a named range. I want to refer to a certain cell
within the range (eg the one in the left corner). However I have some trouble
with the syntax.

ThisWorkbook.Names.Add Name:="FactorCorrRange", _
RefersTo:="=$i$1:$j$5", Visible:=True
var = FactorCorrRange.Offset(1, 1).Text

the program says Error 424 object required. Can someone pls help me? Thanks!