Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default UDF

A long time ago someone gave me this UDF which has been of great value to
me.

Function myCell(Optional Cell)
Application.Volatile
If IsMissing(Cell) Then
myCell = Application.Caller. _
Address(rowabsolute:=False, _
columnabsolute:=False)
Else
myCell = Cell. _
Address(rowabsolute:=False, _
columnabsolute:=False)
End If
End Function

If I type for example: =mycell(K353) returns K353. If I type =mycell($K$353)
it still returns K353.

Question:
What should the UDF look like if I want:

=mycell(K353;1) should return K353
=mycell(K353;2) should return $K353
=mycell(K353;3) should return K$353
=mycell(K353;4) should return $K$353

Hans Knudsen

 
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



All times are GMT +1. The time now is 10:19 PM.

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"