View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default How to define a relative named range in VBA

John,

This does it but you need to do a Ctrl-Alt-F9 to get it to recalculate if
the cell below changes

With ActiveCell
ActiveWorkbook.Names.Add Name:="CellBelow", _
RefersToR1C1:="=!R[1]C[0]"
End With


--

HTH

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


"John Broderick" wrote in message
...
Thanks Bob,

this does the same thing as Insert Name /Define, which is the original
question I asked.

However I now realize when I use CellBelow on any sheet it always refers

to
the original sheet that was active when I defined it.
I want CellBelow to refer to the cell below the active cell on the active
sheet, not the original sheet.

JB