Why does this work... ... but not this?

M

Marcus Ostman

Why does this work...

=WORK("A1")

Function WORK(Cell)
RNG = Range(Cell).Value
MsgBox RNG
End Function

.... but not this?

=WORK(A1)

Function WORK(Cell as Range)
RNG = Range(Cell).Value
MsgBox RNG
End Function

/Marcus
 
E

Eddy

Marcus
In your second example, you have already defined Cell as a range object.
Therefore, you don't need to put the "Cell" (the range object) into another
range object. The following should work:-

RNG = Cell.Value
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top