+ Reply to Thread
Results 1 to 4 of 4

Passing a variable from one Sub to another

  1. #1
    Registered User
    Join Date
    09-09-2014
    Location
    America
    MS-Off Ver
    2010
    Posts
    2

    Passing a variable from one Sub to another

    I'm trying to create in sub 1 a variable called Final which is 4 Random numbers (1-6) Minus the smallest of the 4 Random Numbers in the calculation.
    Then I want to use that number (Final) in another sub. And I want the number generated in the second sub to be a different random number each time and put those numbers in 6 listboxes.
    Please Login or Register  to view this content.

    Again, I want to fill 6 List Boxes with One number each. The number being a Random number each time consisting of 4 Random numbers minus (1-6) the smallest of the 4.

    Thanks in Advance
    Last edited by Leith Ross; 09-28-2014 at 08:53 PM. Reason: Added Code Tags

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,621

    Re: Help with Variables

    Please use Code Tags in your post(s)

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    09-09-2014
    Location
    America
    MS-Off Ver
    2010
    Posts
    2

    Re: Help with Variables

    Thanks So Much

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,621

    Re: Help with Variables

    You're welcome.

    Please don't forget to add code tags to your post.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Passing Variable from one sub to another
    By bbmak in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-27-2014, 12:39 PM
  2. passing variable name...
    By zara_toustra in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-18-2013, 01:15 PM
  3. Passing a variable from one sub to another sub
    By NRMDU in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-25-2013, 04:45 PM
  4. passing variable?
    By leroiv in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-06-2008, 10:52 AM
  5. [SOLVED] Passing variable to VarType of other Variable
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-22-2005, 10:06 AM

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