Avatar of Bert2005
Bert2005Flag for United States of America asked on

Need help organizing the first column of an Excel sheet

Excel 2019. How do I put in the first column a list of three digit numbers like:

256
745
989
284
103
256

Note the first and last are the same.

I want to after putting in 100 numbers or so, be able to make Excel a) delete any duplicates and b) list the numbers in column A from lowest number to highest number.
* Excel TableMicrosoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
Tom Farrar

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Tom Farrar

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Tom Farrar

Having said that, as soon as you select Remove Duplicates it will do just that and there is no reversing the step.  I normally copy the data (in your example Column A) and paste into another column then remove the duplicates.  That way I have both the original list and the reduced-down list where duplicates have been removed.
Flyster

If by first column you mean column A, you can run this macro:
Sub RemoveNSort()
Dim lRow As Double

lRow = Cells(Rows.Count, 1).End(xlUp).Row
Columns("A:A").Select
   ActiveSheet.Range("$A$1:$A$" & lRow).RemoveDuplicates Columns:=1, Header:=xlNo
    ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add2 Key:=Range("A1"), _
        SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
    With ActiveWorkbook.Worksheets("Sheet1").Sort
        .SetRange Range("A1:A" & lRow)
        .Header = xlNo
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
Range("A1").Select
End Sub

Open in new window

Paul
ASKER
Bert2005

I meant the copying.

How do I do the sort column for numbers instead of letters.

Oh I got it. Under Data >> Sort >> then use numbers.
Your help has saved me hundreds of hours of internet surfing.
fblack61
Tom Farrar

Thanks, Bert2005!