LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default address of cell formula is in

Application.Caller returns a range (the range of the cell containing the
function) when called from a cell.

So It is hard to imagine how you could be getting this error using the same
code I provided in the same way I describe.

--
Regards,
Tom Ogilvy

mark kubicki wrote in message
...
gotcha...

and that's where i get the error??


"Tom Ogilvy" wrote in message
...
I put this in a general module

Public Function MyFunc()
Set rng = Application.Caller
MyFunc = rng.Column
End Function

in the worksheet I put in

=myfunc()

and it returns the column of the cell containing the function which is

then
displayed in the cell.


What are you doing?

--
Regards,
Tom Ogilvy

mark kubicki wrote in message
...
i keep getting the error:

run-time 13, type mismatch??


"Tom Ogilvy" wrote in message
...
If your formula is a User defined function, use application.Caller

Public Function MyFunc()
set rng = Application.Caller
Myfunc = rng.column
End Function

as a trivial example.




--
Regards,
Tom Ogilvy

mark kubicki wrote in message
...
how do i get the column number of the cell that my formula is

written
in

guess it's not: activecell.column













 
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
formula to display cell address Jamie Excel Discussion (Misc queries) 3 January 21st 10 05:37 AM
Formula for Cell address Elton Law[_2_] Excel Worksheet Functions 3 April 8th 09 05:23 PM
Formula without cell address Billy Rogers Excel Discussion (Misc queries) 6 May 14th 08 12:59 AM
Cell Address in Formula Laury Excel Discussion (Misc queries) 2 October 8th 07 06:23 PM
cell address from formula JohnJC Excel Discussion (Misc queries) 1 June 14th 06 12:11 PM


All times are GMT +1. The time now is 02:24 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"