Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
xl2k (I think) added an application.calculatefull.
Maybe you could use this: Application.SendKeys "%^{F9}" And if that didn't work, how about recording a macro when you: Select the copied range Edit|Replace what: = (equal sign) with: = (equal sign) replace all. And add that recorded code to your existing macro. "hodler <" wrote: So I wrote a function in excel 97 that works fine. when i select it and copy it down the row, it works fine. But when I have a macro copy it, the cells with my function return the #VALUE error. If i click in the formula bar and press enter, it recalculates fine. I don't want to do this 100 times, though and asking the macro to re calculate or pressing the 'calculate now' button does not help. This is the code for my function but, as I said, it works fine until a macro tries to copy it. Function FindEndOfDrawDown(Peak As Range, Valley As Range, Rng As Range) Dim myCell As Range Dim Past As Boolean Past = False For Each myCell In Rng If Past = True Then If myCell.Value Peak.Value Then FindEndOfDrawDown = myCell.Value Exit Function End If Else If myCell.Value = Valley.Value Then Past = True End If End If Next myCell End Function Please let me know if you have any idea what's going on. I have the feeling it's excel 97 that's screwing up but i cant find any solution on the microsoft support website. thanks Nick --- Message posted from http://www.ExcelForum.com/ -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
User defined function returns imprecise value when used in worksheet | Excel Discussion (Misc queries) | |||
User Defined FUNCTION | Excel Discussion (Misc queries) | |||
user defined function | Excel Worksheet Functions | |||
User-defined data type; Error: Only User-defined types... | Excel Programming | |||
User-Defined Function pre-empting Built-in Function? How to undo???? | Excel Programming |