+ Reply to Thread
Results 1 to 6 of 6

Set Random seed

Hybrid View

  1. #1
    Registered User
    Join Date
    08-31-2011
    Location
    Tokyo
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Set Random seed

    I tried again with this code

    Randomize(1)
    msgbox Rnd
    I put this code on a pushbutton, each time I push it, I have different number. I would like to have the same number because I have seed it.

  2. #2
    Registered User
    Join Date
    08-31-2011
    Location
    Tokyo
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Set Random seed

    I understood how to use it.
    I have to put a negative number for Rnd first and then use Randomize :

    
    Dim i As Long
    Const Max As Long = 10
    Cells.ClearContents
    
    Rnd (-10)
    Randomize (1)
    
    For i= 1 To Max
    Cells(i, 1).Value = Rnd()
    Next

+ 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