Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Range reference

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!


  #2   Report Post  
Posted to microsoft.public.excel.programming
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!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Range reference

Activesheet.Range("i1:j5").Name = "FactorCorrRange"
var = Range("FactorCorrRange")(1).value

--
Regards,
Tom Ogilvy


"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!


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
automatic range - named range give me circular reference... George Thorogood Excel Discussion (Misc queries) 0 February 22nd 07 07:53 PM
VBA reference to 3D range Mike Fogleman Excel Programming 5 January 6th 07 10:22 PM
Can you get the range reference for each page in a worksheet print range? Crosby Excel Programming 3 April 12th 05 06:06 PM
adding reference-to-range control to excel range Nir Sfez Excel Programming 1 March 2nd 04 06:11 PM
Subscript out of Range on Range reference Tom Ogilvy Excel Programming 0 September 13th 03 03:38 PM


All times are GMT +1. The time now is 08:41 AM.

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"