passing cell address to sub - write that cell

O

oldyork90

What am I doing wrong?

function xx (x as range) as whatever
x.value2 = "test"

or
x.text = "test"


compiles - I can see the object - but bombs. ????


Entered function in cell as xx(B5)
 
J

joeu2004

What am I doing wrong?
function xx (x as range) as whatever
x.value2 = "test"
or
x.text = "test" [....]
Entered function in cell as xx(B5)

When VBA code is invoked directly or indirectly from a formula in an Excel,
the VBA code cannot modify cells directly.
 
Top