Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cannot change Cell value

Hi, this gotta be something very simple that I'm missing. The
following function is inside a module and it fails on Worksheet ...
statement. The function returns #value

Function ddddd(X As Double) As Double

Worksheets("Sheet1").Range("A1").Value = 123

ddddd = X + 1

End Function

Also Worksheets("Sheet1").Cells(1,1).Value = 123 fails in the same
manner

Thank you!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Cannot change Cell value

Remove the

Worksheets("Sheet1").Range("A1").Value = 123

A UDF cannot do anything other than return a value to the cell it's in.

--
Jim
wrote in message
ps.com...
| Hi, this gotta be something very simple that I'm missing. The
| following function is inside a module and it fails on Worksheet ...
| statement. The function returns #value
|
| Function ddddd(X As Double) As Double
|
| Worksheets("Sheet1").Range("A1").Value = 123
|
| ddddd = X + 1
|
| End Function
|
| Also Worksheets("Sheet1").Cells(1,1).Value = 123 fails in the same
| manner
|
| Thank you!
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Cannot change Cell value

"Jim Rech" wrote:

A UDF cannot do anything other than return a value to the cell it's in.

--
Jim


True. Also, no formatting can be done. What I found a bit strange when I saw
it, is that a UDF can produce a MsgBox.

--
Wigi
http://www.wimgielis.be = Excel/VBA, soccer and music



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Cannot change Cell value

a UDF can produce a MsgBox

True enough. It just cannot 'do' anything to a workbook itself.

--
Jim
"Wigi" wrote in message
...
| "Jim Rech" wrote:
|
| A UDF cannot do anything other than return a value to the cell it's in.
|
| --
| Jim
|
| True. Also, no formatting can be done. What I found a bit strange when I
saw
| it, is that a UDF can produce a MsgBox.
|
| --
| Wigi
| http://www.wimgielis.be = Excel/VBA, soccer and music
|
|
|


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
change cell contents when pull down menu choices change jb21 Excel Worksheet Functions 3 November 21st 08 10:34 PM
How to trigger one cell change to change another cell using VB in excel? Please help! :) raytan Excel Programming 4 March 26th 07 03:49 AM
making copied cells change with change in original cell Jennifer Mcdermeit Excel Worksheet Functions 2 July 20th 06 04:58 PM
Cell value change to trigger macro (worksheet change event?) Neil Goldwasser Excel Programming 4 January 10th 06 01:55 PM
Change Cell from Validated List Not Firing Worksheet Change Event [email protected] Excel Programming 3 October 4th 04 03:00 AM


All times are GMT +1. The time now is 02:11 PM.

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

About Us

"It's about Microsoft Excel"