+ Reply to Thread
Results 1 to 3 of 3

pass variable for user form module to function

  1. #1
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,173

    pass variable for user form module to function

    I am trying to pass a variable from a user form sub to a function. In the userform code, I have defined "cp" as equal to "c". For some reason when I call the function, it is not passing the value cp. How can I pass this value to the function? Thanks

    Within the userform sub routine I have these lines of code:
    Please Login or Register  to view this content.
    The function is set up as follows:
    Please Login or Register  to view this content.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: pass variable for user form module to function

    Hello maacmaac,

    I don't see anywhere in your code where you pass the value "cp" to the function. That would cause your problem.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,173

    Re: pass variable for user form module to function

    That makes sense now. I didn't think I needed to define in the function. I changed sub to:
    Please Login or Register  to view this content.
    . and function to
    Please Login or Register  to view this content.
    It is working now. Thanks

+ 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