I really appreciate your response. Can you point me to the specific website? If I am not able to find my answer, I will ask you again.All functions available to the worksheet are also available to VBA. VBA also may have it's own, more efficient versions of worksheet functions. If you are looking for a website listing these functions, let me know.
Thank you. I will take a look.Stackoverflow is a great place to get specific answers. Since you are on excel for Mac, it's a bit more challenging for the object model is not the same as a windows machine.
I really appreciate your response. Can you point me to the specific website? If I am not able to find my answer, I will ask you again.
What I was referred to, as an example, was in my VBA subroutine (office 2010 for Mac), if I wanted to calculate an error function (or say a lognormal function), my VBA program did not recognize that function, so I had to sent a number to Excel, used Excel function to compute that function, then fed it back to my VBA subroutine....So a relatively simple subroutine became quite a convoluted task. But for large do loops, iterative computation or Monte Carlo, hard to do that in pure Excel. Or, can I do them in Excel?
Thank you.
Calling Worksheet Functions In VBA
Nearly all worksheet functions can be called from VBA using the Application or Application.Worksheet objects. Excel functions that have native VBA equivalents, such as Month, are not available. The syntax of a worksheet function call is the same as worksheet function itself. For example, a worksheet function in a cell might be:
=VLOOKUP(123,A1:C100,3,FALSE)
To use code in VBA that does the same thing, you would use:
Dim Res As Variant
Res = Application.WorksheetFunction.VLookup(123,Range("A1:C100"),3,FALSE)
The number of parameters and their meanings are the same when calling the function from VBA as they are when calling the function from a worksheet cell. As the code above is written, you will get a runtime error if the value 123 is not found in the range. Therefore, you need to put in some error trapping code:
Dim Res As Variant
On Error Resume Next
Err.Clear
Res = Application.WorksheetFunction.VLookup(123,Range("A1:C100"),3,FALSE)
If Err.Number = 0 Then
''''''''''''''''''''''''''''''''
' Value was found. Continue normal code execution
''''''''''''''''''''''''''''''''
Else
''''''''''''''''''''''''''''''''
' Value was not found. Error code goes here.
''''''''''''''''''''''''''''''''
End If
Thank you very much, userque.
I work almost entirely in Python.Anybody working with node.js or python?