Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I did some UDF on a worksheet. In some cases, I want to prevent executing the UDF, even if an argument changed. This, just because some processec take too much time. Is that possible? thanks a lot for help masterphilch |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The only way to do that would be to put in an argument that tells
the UDF to return some value (e.g., #NA or 0 or "") without doing the real calculation. Public Function MyUDF(<your regular arguments, _ Optional NoCalc As Boolean = False) If NoCalc = True Then MyUDF = CVErr(xlErrNA) Exit Function End If ' rest of your code End Function -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "masterphilch" wrote in message ... Hi I did some UDF on a worksheet. In some cases, I want to prevent executing the UDF, even if an argument changed. This, just because some processec take too much time. Is that possible? thanks a lot for help masterphilch |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
masterphilch wrote:
Hi I did some UDF on a worksheet. In some cases, I want to prevent executing the UDF, even if an argument changed. This, just because some processec take too much time. Is that possible? thanks a lot for help masterphilch -------------------------- What I have done where I have a UDF which is not required 99.9% of the time is to create 2 macros I can execute from a button on the spreadsheet. One of them cycles through all the worksheets and replaces all instances of the function in cells with its current result as a fixed number. The other one cycles through the worksheets and puts the function back into the proper cells if I actually need it. There may well be a more elegant approach. Bill |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
that's what I thought...
I'll try to handle that somehow else... thx |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bill Martin schrieb:
masterphilch wrote: Hi I did some UDF on a worksheet. In some cases, I want to prevent executing the UDF, even if an argument changed. This, just because some processec take too much time. Is that possible? thanks a lot for help masterphilch -------------------------- What I have done where I have a UDF which is not required 99.9% of the time is to create 2 macros I can execute from a button on the spreadsheet. One of them cycles through all the worksheets and replaces all instances of the function in cells with its current result as a fixed number. The other one cycles through the worksheets and puts the function back into the proper cells if I actually need it. There may well be a more elegant approach. Bill Hi thanks for your reply! I already thought about clear the cells in which the UDF is written and reenter the content, when needed. I need to think, what's really needed. thanks anyway! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
HOW CAN I PREVENT EXCEL FILES FROM BEING DELETED OR PREVENT TRASH | Excel Discussion (Misc queries) | |||
need to modify a macro to prevent it from executing if in wrong area of the sheet | Excel Discussion (Misc queries) | |||
executing an add in | Excel Programming | |||
Worksheet_Change Still Not Executing.... | Excel Programming | |||
Code not executing | Excel Programming |