View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Referring to named ranges

You are setting a range object correctly when using a named range, but as it
is already a range object variable, you do not need to use the Range object
in conjunction with the variable.

rngFIData.Select

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Hardy" wrote in
message ...

Hi,

What is best practise in referring to named ranges in VBA? I have
dynamic named ranges in Excel which I wish to refer to in VBA.

Sub Update()

Dim FIData As Range

Set rngFIData = Range("FIData")

Range("rngFIData").Select

End Sub

I get runtime error on the last line. The range name "FIData" is valid
in the sheet. Again, I am not sure I am following best practise, but my
experience is that somtimes it appears to work in some workbooks and not
others...

Thanks


--
Hardy
------------------------------------------------------------------------
Hardy's Profile:

http://www.excelforum.com/member.php...fo&userid=3163
View this thread: http://www.excelforum.com/showthread...hreadid=398985