Welcome Guest
( Log In | Register )
The time is now 10:47 pm
You last visited January 20, 2017, 9:09 pm
All times shown are
Eastern Time (GMT-5:00)

Duplicate Integer Remover

Published:

Last Edited: January 20, 2012, 5:29 pm

Option Explicit

Sub Duplicate__Integer__Remover()
    'by time*treat'
    'grabs a max of about 32,000 integers with values between 0 and 9, inclusive'
    'sorts and removes any duplicates'
    'inputs from one column and outputs to another column'
 
    Dim input__col As Integer, output__col As Integer
    Dim input__row As Integer, output__row As Integer
    Dim holding__tank() As Integer, int__val As Integer
 
    'initialize'
    input__col = 6
    output__col = 10
    ReDim holding__tank(0 To 9)
    For int__val = 0 To 9
      holding__tank(int__val) = 0
    Next int__val
 
    'get list'
    input__row = 1
    While Sheet1.Cells(input__row, input__col).Value <> ""
      holding__tank(Sheet1.Cells(input__row, input__col).Value) = 1
      input__row = input__row + 1
    Wend
 
    'build output'
    output__row = 0
    For int__val = 0 To 9
      If holding__tank(int__val) = 1 Then
        output__row = output__row + 1
        Sheet1.Cells(output__row, output__col).Value = int__val
      End If
    Next int__val
End Sub

Entry #703

Comments

This Blog entry currently has no comments.

You must be a Lottery Post member to post comments to a Blog.

Register for a FREE membership, or if you're already a member please Log In.