+ Reply to Thread
Results 1 to 5 of 5

macro created buttons not working, random numbers not random

  1. #1
    Registered User
    Join Date
    07-01-2017
    Location
    Las Vegas, NV
    MS-Off Ver
    Office 2013
    Posts
    7

    macro created buttons not working, random numbers not random

    I am experiencing an issue with a presentation I am working on. Here is the link to the file. [URL="https://drive.google.com/open?id=0Bz1Rhg3Y5y5KZzRtOHE3dkFxYnM"]

    So you can understand the presentation heres how its set up. Its only two slides.
    Slide one, only one shape that runs the macro "Start"
    Slide two, has 6 stacks of 52 playing cards each, (labeled like AAC which would mean stack A, Ace of Clubs, and E10S for Stack E 10 of Spades)

    Question 1: The presentation has a button on page one that sends you to page 2. It also creates random numbers that determine specific cards that are displayed. I am seeing that every time I run the program the cards are always the same. Repeating the program will display different cards but each time I start the program again the same cards are appearing.

    for example time one will display 10 & 3
    time two will display 7 & 8
    time three will display 4 & 4

    but if I close the program and start it again it will start again with 10 & 3.

    Is there a fix?

    Question 2: the VBA code creates action buttons that will run macros. However if I run the presentation, the buttons are not clickable. Heres the interesting part, if I exit the presentation and reopen the same page, the buttons are clickable, however they still don't function correctly.

    I know the code isn't 100% complete, but its long and I don't want to keep repeating the problem. Any help would be greatly appreciated.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    2007 Enterprise
    Posts
    4,477

    Re: macro created buttons not working, random numbers not random

    .
    I couldn't get your project to run here ... not certain why, so I couldn't test the following.

    Try adding
    Please Login or Register  to view this content.
    in the refresh Sub.

  3. #3
    Registered User
    Join Date
    07-01-2017
    Location
    Las Vegas, NV
    MS-Off Ver
    Office 2013
    Posts
    7

    Re: macro created buttons not working, random numbers not random

    Quote Originally Posted by Logit View Post
    .
    I couldn't get your project to run here ... not certain why, so I couldn't test the following.

    Try adding
    Please Login or Register  to view this content.
    in the refresh Sub.
    Thank you for trying to help.

    Doesn't the "Now()" code refer to the current date and time? How would that help with the random number generator?

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    2007 Enterprise
    Posts
    4,477

    Re: macro created buttons not working, random numbers not random

    .
    Time is ever changing. The thought is there is just enough of a 'micro second difference' between one point and another that the randomness will be truly random.

    If you plug this macro into Excel (the sheet level module) and run it (command button), you'll see that even though the macro was initiated with a single click of the button,
    all three numbers are different. Truly random because Time is ever changing.

    Hopefully, the difference is enough to change up the card display each time.


    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    07-01-2017
    Location
    Las Vegas, NV
    MS-Off Ver
    Office 2013
    Posts
    7

    Re: macro created buttons not working, random numbers not random

    Wow, thats actually a pretty brilliant idea. Thank you.

    I need to still figure out the button issue, but maybe I can figure that out on my own.

    Thank you so much.

+ 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