Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default functions that don't function

Hi,

I am now starting to write my own VBA-UDFs. Amazing effects occur - at least
they don't fail to amaze me. I have code that should be evaluated, and I do
set a Breakpoint and initiate recalculation - nothing happens. The cell I
use for testing contains

=BruttoKV(H4;I4;J3;K4;L4)

and the code contains

Public Function BruttoKV(KVStufe As String, Status As String, Jahr As Long,
UeberStundenPauschale As Boolean, Anstellung As String) As Currency

(I tried this without all the "As"ses also). Code not executed - or so it
seams. The cell then contains #VALUE! (#WERT! in german).
I put in all types of unmeaningful testcode in the BrutoKV-function, like:

If KVStufe = "1" Then
BruttoKV = 120#
Else
BruttoKV = 0#
End If

and nothing else to be sure to see something - no change. I seem to
misunderstand something here completely. Any hints to push me in the right
direction are very much appreciated....

peter


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default functions that don't function

This is only a guess, but try to replace the semi-colons with commas in the
call in the worksheet.

=BruttoKV(H4,I4,J3,K4,L4)
in stead of
=BruttoKV(H4;I4;J3;K4;L4)

=
--
Gary''s Student


"Peter Lipp" wrote:

Hi,

I am now starting to write my own VBA-UDFs. Amazing effects occur - at least
they don't fail to amaze me. I have code that should be evaluated, and I do
set a Breakpoint and initiate recalculation - nothing happens. The cell I
use for testing contains

=BruttoKV(H4;I4;J3;K4;L4)

and the code contains

Public Function BruttoKV(KVStufe As String, Status As String, Jahr As Long,
UeberStundenPauschale As Boolean, Anstellung As String) As Currency

(I tried this without all the "As"ses also). Code not executed - or so it
seams. The cell then contains #VALUE! (#WERT! in german).
I put in all types of unmeaningful testcode in the BrutoKV-function, like:

If KVStufe = "1" Then
BruttoKV = 120#
Else
BruttoKV = 0#
End If

and nothing else to be sure to see something - no change. I seem to
misunderstand something here completely. Any hints to push me in the right
direction are very much appreciated....

peter



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default functions that don't function

To force the function to to re-evalueate you can try using

application.volitile

Volitile meand that the function will re-calc every time a calc occures,
similar to the now function. Just a shot in the dark...
--
HTH...

Jim Thomlinson


"Peter Lipp" wrote:

Hi,

I am now starting to write my own VBA-UDFs. Amazing effects occur - at least
they don't fail to amaze me. I have code that should be evaluated, and I do
set a Breakpoint and initiate recalculation - nothing happens. The cell I
use for testing contains

=BruttoKV(H4;I4;J3;K4;L4)

and the code contains

Public Function BruttoKV(KVStufe As String, Status As String, Jahr As Long,
UeberStundenPauschale As Boolean, Anstellung As String) As Currency

(I tried this without all the "As"ses also). Code not executed - or so it
seams. The cell then contains #VALUE! (#WERT! in german).
I put in all types of unmeaningful testcode in the BrutoKV-function, like:

If KVStufe = "1" Then
BruttoKV = 120#
Else
BruttoKV = 0#
End If

and nothing else to be sure to see something - no change. I seem to
misunderstand something here completely. Any hints to push me in the right
direction are very much appreciated....

peter



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
MODE function where there are no common functions. DJFudd Excel Discussion (Misc queries) 1 July 22nd 09 03:41 AM
nested functions using insert function Annie Excel Worksheet Functions 1 May 2nd 08 12:40 PM
Is there any function or macro to get all the available functions? PK Excel Discussion (Misc queries) 2 December 24th 07 12:00 PM
nest functions in CELL function [email protected] Excel Worksheet Functions 1 January 30th 06 09:37 AM
And/or Functions /Countif Function brianwakin Excel Programming 2 August 23rd 05 08:36 PM


All times are GMT +1. The time now is 12:07 AM.

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"