Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to define a relative named range in VBA

Or in code (missed that):

ActiveWorkbook.Names.Add Name:="CellBelow", _
RefersToR1C1:="=INDIRECT(""r[1]c"",FALSE)"

Dave Peterson wrote:

How about:
Insert|Name|Define
Cellbelow
=INDIRECT("r[1]c",FALSE)

John Broderick wrote:

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


--

Dave Peterson


--

Dave Peterson
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
How do I have a cell value define a dynamic named range? CellShocked Excel Worksheet Functions 15 October 26th 11 02:08 AM
Named Range that uses "relative" range - Possible? Johnny_99 Excel Worksheet Functions 5 December 14th 09 08:39 AM
How to define a Named Range in VBA? Richard Excel Programming 3 December 12th 05 06:49 PM
Define a range based on another named range Basil Excel Worksheet Functions 2 February 21st 05 01:47 PM
relative reference in a macro to define a name Hal Forman Excel Programming 2 May 28th 04 07:13 PM


All times are GMT +1. The time now is 11:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"