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)
 
C

Claus Busch

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.
 
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.
 

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