looking to work with other traders/coders

Discussion in 'Hook Up' started by Jeffro72, Sep 15, 2017.

  1. toucan

    toucan

    Jeff.... I have opened up a private thread if you wish to discuss further.


    toucan
     
    #21     Sep 19, 2017
    Jeffro72 likes this.
  2. toucan

    toucan

    I'm not sure you know about private threads... they can be found in the upper right corner of this page under "inbox".... can't remember if you get an invite email... :)

    toucan
     
    #22     Sep 19, 2017
    Jeffro72 likes this.
  3. ironchef

    ironchef

    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.
     
    #23     Sep 19, 2017
  4. Sprout

    Sprout

    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.
     
    #24     Sep 20, 2017
    userque likes this.
  5. ironchef

    ironchef

    Thank you. I will take a look.
     
    #25     Sep 20, 2017
  6. userque

    userque

    Yeah...that does convolute things! You can use WorksheetFunction. See this excellent site:
    http://www.cpearson.com/excel/callingworksheetfunctionsinvba.aspx

    See also: https://msdn.microsoft.com/en-us/library/office/hh211481(v=office.14).aspx

    Quote from http://www.cpearson.com/excel/callingworksheetfunctionsinvba.aspx :
    Code:
    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 
     
    #26     Sep 20, 2017
  7. ironchef

    ironchef

    Thank you very much, userque.
     
    #27     Sep 20, 2017
  8. userque

    userque

    Anytime ironchef.
     
    #28     Sep 20, 2017
  9. Jeffro72

    Jeffro72

    Good stuff. Thanks for all the good info and PMs.
     
    #29     Sep 20, 2017
    userque likes this.
  10. jjapp

    jjapp

    I work almost entirely in Python.
     
    #30     Sep 23, 2017
    Sprout likes this.