passing cell address to sub - write that cell

  • Thread starter Thread starter oldyork90
  • Start date Start date
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)
 
Hi,

Am Tue, 4 Feb 2014 20:18:30 -0800 (PST) schrieb (e-mail address removed):
function xx (x as range) as whatever
x.value2 = "test"

try:
Function xx(x As Range) As String
xx = x.Value
End Function


Regards
Claus B.
 
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.
 
Back
Top