+ Reply to Thread
Results 1 to 5 of 5

Random cards, shuffle and reveal help

  1. #1
    Registered User
    Join Date
    08-12-2009
    Location
    Ebensburg
    MS-Off Ver
    Excel 2003
    Posts
    2

    Question Random cards, shuffle and reveal help

    Hi there! I'm trying to get randomized numbers (R2:R61) to match up with their corresponding card name ('-Deck construction-'!J3:J62) and then print all

    the cards at (B2:B61) down the row.

    ' Generate Card 1
    If Worksheets(2).Range("R2").Value = 1 Then Worksheets(2).Range("B2").Value = Worksheets(1).Range("J2")
    If Worksheets(2).Range("R2").Value = 2 Then Worksheets(2).Range("B2").Value = Worksheets(1).Range("J3")
    ...
    If Worksheets(2).Range("R2").Value = 59 Then Worksheets(2).Range("B2").Value = Worksheets(1).Range("J60")
    If Worksheets(2).Range("R2").Value = 60 Then Worksheets(2).Range("B2").Value = Worksheets(1).Range("J61")
    VB will only generate 5 cards, then it tells me that the code is too large to process.

    Also my project (hobby more so) is available for download. It's still in the bare-bones state and will like criticism that'll help me. Thanks! I'm guessing a loop of some type would be used, but that's all I (think I do) know
    Attached Files Attached Files

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Random cards, shuffle and reveal help

    I think you are assuming we know what you are talking about. You need to explain more fully & your question's title needs to give an idea of the problem. Read the Forum Rules.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    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: Random cards, shuffle and reveal help

    Hello dude846,

    Welcome to the Forum!

    This macro will load the "shuffled" text into the appropriate column. It will only accept shuffle numbers from 1 to 5.
    Please Login or Register  to view this content.
    Calling Example in VBA code
    Please Login or Register  to view this content.
    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!)

  4. #4
    Registered User
    Join Date
    08-12-2009
    Location
    Ebensburg
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Random cards, shuffle and reveal help

    Sorry for the late response. I made a picture that should help a bit better.

    Right now I have "Random #" create a stack of random numbers 1-60 at range (R1:R61). I'm having problems getting those random numbers to link with their appropriate card that I have listed in order in another worksheet, for ease I put that list on the picture as well.

    ffdasd is card name 1.
    u is card name 8
    KLJ is card name 34
    ...

    I'm trying to get those names to be re listed at range B1:B61 in their new, random order.

    Thank you for your responses. I've uploaded the version with the script posted above, and I don't know how to call that module up in the worksheet. I recieve an error "Argument not optional" when I try to force the script to load (It's linked on the uploaded workbook with "Shuffle Decks").

    \1

    I'd like to be able to shuffle the deck 5 times with one button press, and list all 5 random shuffles at once without the need of that extra button. But I'll worry about that once I get the basic learned and working.

    Sorry, I'll be able to read this post more readily tonight. Thanks
    Attached Files Attached Files

  5. #5
    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: Random cards, shuffle and reveal help

    Hello dude846,

    I have added a macro to the "Shuffle" button which now creates 5 random lists and shuffles 5 times. Each shuffle is then filled in. Here are the macro that are called by the "Shuffle" button.
    Please Login or Register  to view this content.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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