Consulting

Results 1 to 7 of 7

Thread: Sheet continuation

  1. #1

    Sheet continuation

    hello,

    i had 300,000 generated numbers and i want those numbers to display each row on excel worksheet. the problem is, excel has only 65536 rows available for each worksheet.
    how can i display the remaining generated numbers into another worksheet or maybe add worksheet for the continuation of my results.

    thanks

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    How are you getting the generated numbers into Excel? Is Excel generating them or are you trying to import them?

  3. #3
    VBAX Regular
    Joined
    Feb 2005
    Location
    North West London, UK
    Posts
    19
    Location
    If you want to generate 300,000 random integers for example between 0 and 100 you can use

    =INT(RAND()*101)
    Copy down the column to row 60000 and copy the whole column and paste it into 4 more columns in the same worksheet or different worksheets. If required convert them to values using Copy/Edit/PasteSpecial/Values.

  4. #4
    DRJ, patrickab,

    thanks for your time. i had vba that generate 5 combination of numbers 1 30. those generated number will display each row every combination. something like lotto generated number. my problem is how can i add or even goto next sheet as my result reach 65536 rows.

  5. #5
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    I suppose you have a loop that goes from 1 to 300,000. You could add something like this.


    Dim Counter As Long
    Dim ws As Worksheet
    Counter = 1
    Set ws = Sheets.Add
    'Loop Starts Here
    For i = 1 to 300000
    ws.Range("A" & Counter).Value = Random Number Code Here
    If Counter = 65536 Then
    Set ws = Sheets.Add
    Counter = 1
    Else
    Counter = Counter + 1
    End If
    Next i

    If you need more specific help, post the current code that you are using.

  6. #6
    thanks DRJ you're a big help.

  7. #7
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    You're Welcome

    Take Care

Posting Permissions

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