Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
using worksheet functions in code
can i access, in vba, all functions that excel uses on their spreadsheets?
i am looking to use 'yield' and 'price' functions in vba. thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
using worksheet functions in code
Hi Mike,
Many, but not all, Excel worksheet functions are available to VBA. See 'List of Worksheet Functions Available to Visual Basic' in VBA help. The Yield and Price functions are part of the Analysis Toolpak. You need to load the 'Analysis ToolPak - VBA' Addin to use these functions in VBA. --- Regards, Norman "mike allen" wrote in message ... can i access, in vba, all functions that excel uses on their spreadsheets? i am looking to use 'yield' and 'price' functions in vba. thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
using worksheet functions in code
You can access some of Excel's functions using
Application.WorksheetFunctions, but not all. I did not see 'yield' or 'price' when I looked in the Object Browser. "mike allen" wrote in message ... can i access, in vba, all functions that excel uses on their spreadsheets? i am looking to use 'yield' and 'price' functions in vba. thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
using worksheet functions in code
If the worksheet function is available, it's better to use
application.worksheetfunction.functionname (or application.functionname), but if the function is not available, you can use Evaluate. I looked at the help for Price and did this in code: Option Explicit Sub testme() Dim myFormula As String myFormula = "price(" & CLng(DateSerial(2008, 2, 15)) & "," & _ CLng(DateSerial(2017, 11, 17)) & "," & _ "0.0575,0.065,100,2,0)" MsgBox Application.Evaluate(myFormula) End Sub I got the same answer as the help showed. mike allen wrote: can i access, in vba, all functions that excel uses on their spreadsheets? i am looking to use 'yield' and 'price' functions in vba. thanks -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to convert cell formula functions to code functions | Excel Discussion (Misc queries) | |||
not sure what functions/code to use? | Excel Programming | |||
Create a newworksheet with VBA code and put VBA code in the new worksheet module | Excel Programming | |||
Public Functions As Worksheet Available Functions | Excel Programming | |||
Using code instead of worksheet functions | Excel Programming |