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

  • Thread starter Thread starter Marcus Ostman
  • Start date Start date
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
 
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
 
Back
Top