Results 1 to 3 of 3
  1. #1
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 0 Times in 0 Posts

    When is 'CALL' necessary? (Excel VBA)

    Please clarify when call is necessary! I can run other procedures from a sub by just writing its name in the code. Then others tell me that its more correct to use Call "ProcName". So when do I use it and when don't I? It must have a purpose in VBA else it would not be there.
    Tx
    Regards,
    Rudi

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: When is 'CALL' necessary? (Excel VBA)

    If you look up Call in the VBA help, you'll find that Call is not required. Both

    MyProc "Rudi", 37

    and

    Call MyProc("Rudi", 37)

    are correct. However, some programmers prefer to use Call for user-defined procedures and functions because it makes it easy to distinguish between calls to user-defined and built-in code.

  4. #3
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: When is 'CALL' necessary? (Excel VBA)

    Tx a stack!

    PS: I think I'll Call Hans again when I need help. Using call here is better than just saying Hans..., as it seems more respectful and it is good manners <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Regards,
    Rudi

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •