LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 88
Default Calculation of an UDF

Hello,

I've made an UDF to determine, whether a cell has a formula or not,
see listing below:

++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++
Public Function CellHasFormula(Cell As Range) As Variant

' Error trapping
On Error GoTo FuncFail:

' Exit, if cell has formula and cell isn't recalculated.
If IsEmpty(Cell) And Len(Cell.Formula) 0 Then Exit Function

' determines whether cell has formula
CellHasFormula = Cell.HasFormula
Debug.Print Cell.Row & " / " & Cell.Column
Exit Function

' Error trapping
FuncFail:
CellHasFormula = CVErr(xlErrNA)
End Function
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++

The tested cell is referenced by the argument of the UDF, so it should
calculate whenever the referenced cell is changed and in general it
works as it should.

But now, the part I don't understand.
I have a cell which is no precedent to the cell with the udf and I can
change it in two ways:
1. I select a value from the validation dropdown
2. I enter a valid value manually into the cell.

When I do it the first way, the UDF is calculated and when I do it the
second way it is not calculated.

Is it a difference to use validation drop down or not?

Regards
Werner

Excel XP SP 3
WIN XP SP 3
 
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
Calculation AlanW Excel Discussion (Misc queries) 1 October 12th 07 11:25 AM
Calculation Bill Ridgeway Excel Discussion (Misc queries) 5 July 2nd 07 01:17 PM
Help with calculation scripttron75 Excel Discussion (Misc queries) 1 December 20th 05 05:50 AM
How do I use a rounded calculation result in another calculation? vnsrod2000 Excel Worksheet Functions 1 January 26th 05 10:11 PM
How do I use a rounded calculation result in another calculation? vnsrod2000 Excel Worksheet Functions 1 January 26th 05 09:36 PM


All times are GMT +1. The time now is 10:05 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"