Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-17-2009, 05:40 AM
kgfendi kgfendi is offline creating unique numbers in excel Windows Vista creating unique numbers in excel Office 2007
Novice
 
Join Date: May 2009
Posts: 7
kgfendi is on a distinguished road
Default

HI,

This is typical type for sorting 5 different numbers. You can change the code to be more than this number (exmaple 2000). Good luck for coding!!

Code:
Sub Sorting()
 
    Dim Used(10) As Boolean
    Dim TheRandom As Integer
    For i1 = 1 To 10
    Used(i1) = False
    Next i1
 
    For i = 1 To 5
        Do
        TheRandom = Int(Rnd(i) * 10)
        Loop Until Not Used(TheRandom)
        Used(TheRandom) = True
 
    ActiveCell.Offset(i, 0) = TheRandom
 
    Next i
End Sub
Please get back again if you could not match this solution to accord your numbers!

Kind Regards

Last edited by Bird_FAT; 05-17-2009 at 08:43 AM. Reason: added code brackets
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Pasting numbers: Darren Word 0 04-01-2009 11:22 AM
creating unique numbers in excel Page numbers...starting on page 3 Motiv8td1 Word 2 02-21-2009 07:21 AM
creating unique numbers in excel Creating Hyperlinks alicein1derville Excel 5 02-08-2009 10:31 PM
Reversed Printing of Numbers in Numbered Documents HCM1962 Word 0 09-22-2008 10:39 AM
Creating a Distrubution List from Excel webphotogeek Outlook 0 01-10-2008 11:21 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:47 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft