Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Dear all, The following function is a sample in Excel's help. When I use it in a worksheet giving a cell reference as the argument (the cell contains a formula which refers to other cells), the function runs twice. I mean when the line End Function was executed, it just went back to the first line (_If_NumberArg_<_0_Then_) and run all lines through again. I also have a few DIY functions that run even four times when used in worksheet. Code: -------------------- Function CalculateSquareRoot(NumberArg As Double) As Double If NumberArg < 0 Then ' Evaluate argument. Exit Function ' Exit to calling procedure. Else CalculateSquareRoot = Sqr(NumberArg) ' Return square root. End If End Function -------------------- Can anyone tell me why is this phenomenon and how to stop this happening? Many thanks, Huyeote -- Huyeote ------------------------------------------------------------------------ Huyeote's Profile: http://www.excelforum.com/member.php...o&userid=13894 View this thread: http://www.excelforum.com/showthread...hreadid=549330 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA macro runs fine, but freezes if I try to do ANYTHING else whileit runs | Setting up and Configuration of Excel | |||
One macro runs then it auto runs another macro | Excel Discussion (Misc queries) | |||
OLE text runs together | Excel Programming | |||
macro runs except from function | Excel Programming |