Consulting

Results 1 to 11 of 11

Thread: Random Date Generator Help Please

  1. #1
    VBAX Regular
    Joined
    Apr 2012
    Posts
    13
    Location

    Random Date Generator Help Please

    Hi,

    I am trying to write a code that will give a random group of 23 people,how likely is it that two people have the same birthday. i need to write a program that creates a random date array from 1 to 23 (being the number of people) and to assign each of the 23 people a random date integer from 1 to 365 the program needs to check all the dates to see if theres are any matching dates and to be repated 100 times for how many matching birthdays there would be and i need the answer to be around 50 to 60%.

    so far i have got a code that will randomly display a date but im not to sure on the rest would some one be able to help me out
    thanks


    this is the code i have so far
    HTML Code:
    Sub GenerateRandomNumberInRange()
        Dim MaxNumber As Integer
        Dim MinNumber As Integer
        Dim RandomNumber As Integer
        MinNumber = 1
        MaxNumber = 365
        RandomNumber = Int((Rnd * (MaxNumber - MinNumber + 1)) + MinNumber)
        Debug.Print DateSerial(1983, 1, RandomNumber)
        '
        msg = DateSerial(1983, 1, RandomNumber)
        MsgBox msg
    End Sub

  2. #2
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    You have already posted this question.

    http://www.vbaexpress.com/forum/showthread.php?t=41854

    So...read that post. I do not think anyone will help you with this. At least I hope not.

  3. #3
    VBAX Regular
    Joined
    Apr 2012
    Posts
    13
    Location
    Quote Originally Posted by fumei
    You have already posted this question.

    http://www.vbaexpress.com/forum/showthread.php?t=41854

    So...read that post. I do not think anyone will help you with this. At least I hope not.
    do u seriously go through peoples profiles to see if they have posted about it?

    i am asking a question and need help why cant you help me

  4. #4
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Cross-posted at: http://www.tek-tips.com/viewthread.cfm?qid=1683040
    For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  5. #5
    VBAX Regular
    Joined
    Apr 2012
    Posts
    13
    Location
    Quote Originally Posted by macropod
    Cross-posted at: http://www.tek-tips.com/viewthread.cfm?qid=1683040
    For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184
    and?

  6. #6
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Did you read the material in the link? Somehow I think not. At this rate, you're on a short path to being banned from at least one forum...
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  7. #7
    VBAX Regular
    Joined
    Apr 2012
    Posts
    13
    Location
    Quote Originally Posted by macropod
    Did you read the material in the link? Somehow I think not. At this rate, you're on a short path to being banned from at least one forum...
    there no rule saying just because i post on ur site i cant post on others

  8. #8
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    No, that is true. BUT if you read the link on cross-posting (and I agree with macropod that you probably have not), then you would understand why it is being mentioned.

    We do this for free, and we do not like wasting our time. You can do multiple posts in different forums but tell us. To do otherwise is rude.

    As stated, you have asked this before. You got a response, and a link. You did not do much with it it seems. So you just asked again. You are wasting our time. We are not here to just to give you answers.

  9. #9
    VBAX Regular
    Joined
    Apr 2012
    Posts
    13
    Location
    i ask again because i dont get the answer

  10. #10
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Given that there's been no indication from you in the other thread that you tried to apply the logic in the link there, how was anyone to know you didn't have the answer you needed? And why start a new thread? If you have unresolved issues with the advice you've already been given, then ask more questions in the same thread. Don't just start new threads in this or other forums and pretend no-one's going to notice.
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  11. #11
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    We are not here to give you an answer. We are here to help you (if you are willing) to find an answer. Yes, sometimes we give straight answers, but you question does not have one. We gave you something to start with, and you have little with that. As macropod states, if you are still struggling with it, ask for more help IN THE SAME THREAD.

    This is not a free-for-all. There are established rules of behaviour and etiquette. Please follow them or you will be possibly banned.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •