From: G.P.N.L. c.v.a. on
I want to make a UDF,
in which I use the address of the cell itself in VLOOKUP.

How do I define the address of the cell ?

cell("address") give an error

Tx,
Gilbert


From: Bob Phillips on
Try

cell.Address

--

HTH

Bob

"G.P.N.L. c.v.a." <gpnl(a)skynet.be> wrote in message
news:uyBkdjJ1KHA.4440(a)TK2MSFTNGP04.phx.gbl...
>I want to make a UDF,
> in which I use the address of the cell itself in VLOOKUP.
>
> How do I define the address of the cell ?
>
> cell("address") give an error
>
> Tx,
> Gilbert
>
>


From: Mike H on
Hi,

Address is a property of a range object so along these lines

r = ActiveCell.Address

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"G.P.N.L. c.v.a." wrote:

> I want to make a UDF,
> in which I use the address of the cell itself in VLOOKUP.
>
> How do I define the address of the cell ?
>
> cell("address") give an error
>
> Tx,
> Gilbert
>
>
> .
>
From: G.P.N.L. c.v.a. on
This is OK as long as the cursor is in the cell you want.
If I put this address in X1, it gives indeed a VLOOPUP with X2 as the first
argument,
but when X2 is active, the result in X1 is a VLOOKUP with X2 as the first
argument.

"Mike H" <MikeH(a)discussions.microsoft.com> wrote in message
news:D197DF2E-F774-4DB3-88AD-264B40616412(a)microsoft.com...
> Hi,
>
> Address is a property of a range object so along these lines
>
> r = ActiveCell.Address
>
> --
> Mike
>
> When competing hypotheses are otherwise equal, adopt the hypothesis that
> introduces the fewest assumptions while still sufficiently answering the
> question.
>
>
> "G.P.N.L. c.v.a." wrote:
>
>> I want to make a UDF,
>> in which I use the address of the cell itself in VLOOKUP.
>>
>> How do I define the address of the cell ?
>>
>> cell("address") give an error
>>
>> Tx,
>> Gilbert
>>
>>
>> .
>>


From: G.P.N.L. c.v.a. on
Does not work, Bob,

Function ZKP() As String

Dim RESULT As String

ADRES = Cell.Address

RESULT = WorksheetFunction. _
VLookup(ADRES, _
Workbooks("CONNECTIONS.xls"). _
Sheets("DB"). _
Range("db" & Left(ActiveWorkbook.Name,
Len(ActiveWorkbook.Name) - 4)), _
2, _
False)
ZKP = RESULT

End Function

gives #VALUE!

"Bob Phillips" <bob.phillips(a)somewhere.com> wrote in message
news:e6X5j$J1KHA.4420(a)TK2MSFTNGP02.phx.gbl...
> Try
>
> cell.Address
>
> --
>
> HTH
>
> Bob
>
> "G.P.N.L. c.v.a." <gpnl(a)skynet.be> wrote in message
> news:uyBkdjJ1KHA.4440(a)TK2MSFTNGP04.phx.gbl...
>>I want to make a UDF,
>> in which I use the address of the cell itself in VLOOKUP.
>>
>> How do I define the address of the cell ?
>>
>> cell("address") give an error
>>
>> Tx,
>> Gilbert
>>
>>
>
>