PC Review


Reply
Thread Tools Rate Thread

Cannot change Cell value

 
 
brains4math@gmail.com
Guest
Posts: n/a
 
      9th Jul 2007
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!

 
Reply With Quote
 
 
 
 
Jim Rech
Guest
Posts: n/a
 
      9th Jul 2007
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
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
| 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!
|


 
Reply With Quote
 
=?Utf-8?B?V2lnaQ==?=
Guest
Posts: n/a
 
      9th Jul 2007
"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 With Quote
 
Jim Rech
Guest
Posts: n/a
 
      10th Jul 2007
>>a UDF can produce a MsgBox

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

--
Jim
"Wigi" <(E-Mail Removed)> wrote in message
news:C6731256-C532-477A-907E-(E-Mail Removed)...
| "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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing the cell format doesn't change existing cell content Kate Microsoft Excel Misc 2 14th Jan 2010 04:44 PM
Need Help, DataGrid, Cell color change on cell data change =?Utf-8?B?QnJpYW5ESA==?= Microsoft C# .NET 0 13th Jun 2007 03:45 PM
Change in DataGrid Cell (combobox) should cause change in another cell (TextBox) joinzulfi@gmail.com Microsoft VB .NET 0 5th Apr 2007 08:00 AM
How to trigger one cell change to change another cell using VB in excel? Please help! :) raytan Microsoft Excel Programming 4 26th Mar 2007 03:49 AM
Worksheet shakes like Rock n' Roll - how check the cell beside upon a singel cell change? Microsoft Excel Misc 1 4th May 2004 07:57 AM


Features
 

Advertising
 

Newsgroups
 


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