Re: Writing values to cells
- From: "Bob" <someonw@xxxxxx>
- Date: Wed, 5 Mar 2008 09:42:16 -0800
Thanks for your help. So, is there any way of writing a value to a cell (in
a UDF) that is not adjacent to the cell where the function is called?
Thanks;
Bob
"Gary''s Student" <GarysStudent@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:84BB5B5E-9AD8-4683-95C7-3C46FF2BC660@xxxxxxxxxxxxxxxx
With some very rare exceptions, VBA functions can only return a value to
the
cell in which the function resides.
1. It can cause other cells to change only with the help of a "helper"
macro
2. It can't change the format of cells
3. It CAN insert or change comments
4. It can return values to several adjacent cells if the UDF returns an
array.
--
Gary''s Student - gsnu200771
"Bob" wrote:
Hi everyone:
Does anyone know why in VBA for excel, why I cannot write a value to a
cell
in a function, but I can in a sub without arguments? Is this a bug? For
example;
Public Function w(x As Double) As Double
Range("A1").Value = x
End Function
does not work. Whereas;
Public Sub w()
Range("A1").Value = 3.23
End Sub
Does work.
So, inside a function, how can I write to a cell? I appreciate your
help.
Bob
.
- Follow-Ups:
- Re: Writing values to cells
- From: Gary''s Student
- Re: Writing values to cells
- References:
- Writing values to cells
- From: Bob
- Writing values to cells
- Prev by Date: Re: Functions in VBA
- Next by Date: Re: Functions in VBA
- Previous by thread: Writing values to cells
- Next by thread: Re: Writing values to cells
- Index(es):
Relevant Pages
|
|