+ Reply to Thread
Results 1 to 5 of 5

VBA Function Help

  1. #1
    Registered User
    Join Date
    07-20-2005
    Posts
    6

    VBA Function Help

    Hi,

    I'm trying to simplify some of my VBA function codes. For example:
    Please Login or Register  to view this content.
    Is it possible to not keep typing in the "zzz = x+y" line in each function that needs the "zzz" value?

    Thanks,

    Jay
    Last edited by Jay637; 04-17-2008 at 06:16 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Jay, please edit your post to use code tags. If you don't know how, please read the forum rules.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-20-2005
    Posts
    6
    Thanks for the quick reply, shg.

    I'm sorry I wasn't clear in my question.

    Please Login or Register  to view this content.
    The above line of code is actually supposed to be a really long equation that I reuse in a few on my functions. Is there a way of just determining the value once in a module then being able to use that value for a few different functions without reentering it in each of my function codes?

    Thanks,

    Jay

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Yes: encapsulate it as a function of its own.

    That's why you have a Sin function, so you don't have to code a Taylor series expansion every time you need one

  5. #5
    Registered User
    Join Date
    07-20-2005
    Posts
    6
    Thanks a lot shg... I appreciate the help!
    Last edited by Jay637; 04-17-2008 at 07:49 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1