Range reference

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!
 
Arne,

try it this way:

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top