+ Reply to Thread
Results 1 to 4 of 4

Random setup configuration code for vba

  1. #1
    Registered User
    Join Date
    12-18-2012
    Location
    Tilburg, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    13

    Random setup configuration code for vba

    Hi All,

    I have a configuration problem for which i would like to know how I can pick a random setup, I will try to explain my problem the best I can and hope that somebody can help me, because I really have no clue on how to do this.

    So I need to configure an production line with 4 stations in a sequence. In every station I have the choice of a number of different types of machines ( for example station 1, i can choose machine of type 1, 2 or 3, station 2 type 1 or 2, etc. ) and also I can choose a number of machines at each station (which I know will probably always be lower than 10). To give an example of a configuration, it would be something like this:

    Station 1: 2x Machine type 1
    Station 2: 5x Machine type 2
    Station 3: 3x Machine type 4
    Station 4: 7x Machine type 2

    How do I make VBA pick a random setup? What so for example get a table like this at random;

    station machines type
    1 2 1
    2 5 2
    3 3 4
    4 7 2





    Thanks in advance for taking a look at my problem!
    Bram
    Last edited by Brammer88; 12-29-2012 at 06:33 PM.

  2. #2
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Random setup configuration code for vba

    Have you tested the function "RANDBETWEEN"?

    Alf

  3. #3
    Registered User
    Join Date
    12-18-2012
    Location
    Tilburg, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Random setup configuration code for vba

    Hi Alf,

    Thanks a lot, works perfectly!

  4. #4
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Random setup configuration code for vba

    Glad to be of help! Thanks for feedback.

    Alf

+ 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