Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default changing cell values from within UDF

I made a UDF (so residing in a function module) and want to change the
value of a cell on "sheet1" but this doesn't work. I can read the value
but not set it. Like it was read-only. It doesn't seem to work with
other properties (e.g. colour) to

Regards
Benny

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default changing cell values from within UDF

Benny,

A UDF can only return a result, it cannot change properties of a worksheet
or cells. The result will show in the cell that the UDF is called in but
that is it.

If you want to set colour, you could use conditional formatting based upon
the value in a cell.

--

HTH

RP
(remove nothere from the email address if mailing direct)


wrote in message
oups.com...
I made a UDF (so residing in a function module) and want to change the
value of a cell on "sheet1" but this doesn't work. I can read the value
but not set it. Like it was read-only. It doesn't seem to work with
other properties (e.g. colour) to

Regards
Benny



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default changing cell values from within UDF

A function called from a worksheet cell cannot make any changes
to the Excel environment, including change the value of another
cell. It can only return a value to the which called it.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


wrote in message
oups.com...
I made a UDF (so residing in a function module) and want to
change the
value of a cell on "sheet1" but this doesn't work. I can read
the value
but not set it. Like it was read-only. It doesn't seem to work
with
other properties (e.g. colour) to

Regards
Benny



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default changing cell values from within UDF

UDF's are not allowed to change the structure of the worksheet. You'll have
to put the changes you want to make in a SUB module.

wrote in message
oups.com...
I made a UDF (so residing in a function module) and want to change the
value of a cell on "sheet1" but this doesn't work. I can read the value
but not set it. Like it was read-only. It doesn't seem to work with
other properties (e.g. colour) to

Regards
Benny



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to store changing values from one cell Emmie Excel Discussion (Misc queries) 5 September 17th 06 08:10 PM
changing cell values jamie&slings Excel Discussion (Misc queries) 1 May 3rd 06 01:29 AM
Changing cell values JulieD Excel Programming 4 April 13th 05 05:48 PM
Changing cell values Don Guillett[_4_] Excel Programming 0 April 13th 05 05:08 PM
Changing Values In A Cell RAYMOND KELLY Excel Programming 5 June 25th 04 06:01 PM


All times are GMT +1. The time now is 04:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"