View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Martin Fishlock Martin Fishlock is offline
external usenet poster
 
Posts: 694
Default Dynamic Formula with Dynamic Address

Hi,

I managed to get this to work on and off, which is a starting point:

name this=INDIRECT(CELL("address"))

and then offset(this,0-2)

but it kept on switching on and off.

So the other way to do it is a macro with

Function myoffset(offsetrow As Long, offsetcolumn As Long) As Variant

myoffset = Application.Caller.Offset(offsetrow, offsetcolumn).Value

End Function

--
Hope this helps
Martin Fishlock
Please do not forget to rate this reply.


"dmz_asdf" wrote:

In a worksheet cell, the following works, but when copied into a name, it
returns #VALUE since the INDIRECT fails.

=EOMONTH(DATE(OFFSET(INDIRECT(ADDRESS(ROW(),COLUMN ())),0,-1),OFFSET(INDIRECT(ADDRESS(ROW(),COLUMN())),0,-2),1),0)

Column 1 has month values
Column 2 has year values
Column 3 has the formula

I thought this would be a valid extrapolation of dynamic ranges, but perhaps
I should be looking into something else.