get cell of function

M

masterphilch

Hi

Can I somehow determine, in which column (A,B,C,...) a selfmade function
is called?
Or: Can I tell the function, placed f.e. in cell C1, to loop through the
column left (in this example B) of it?

thanks lot for help
materphilch
 
G

Gary''s Student

Dim rng as Range
set rng = Application.Caller

to see the value:

MsgBox(rng.address)


Gary's Student
 
B

Bob Phillips

As answered in .programming

Application.Caller.Address

will get the calling cell address.

The second part could be done with

For Each cell In
Range(Application.Caller.Address).Offset(0,-1).EntireColumn
'do stuff on cell
Next cell


--

HTH

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