Need to list all values present in the column

stepan1987

Board Regular
Joined
May 6, 2011
Messages
92
Hi guys,
I need to get a range of all values present in one column and list them in the other column:

Red
Blue
Red
Red
Green
Grey
Green

Need to get in alphabetical order:

Blue
Green
Grey
Red

Which formula does that? Thanks in advance
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
why do you want a formula

suppose data is like this in A1 to A8

colors
Red
Blue
Red
Red
Green
Grey
Green

highlight A1 to A8
clcik data-filter-advancedfilter
choose "copy to another location"
check "unique records only" at the bottom
against "copy to" type B1
click OK
.
now you wil get B1 to B6

colors
Red
Blue
Green
Grey

sort column B ascending.
 
Upvote 0
Code:
Sub test()
    Range("=OFFSET($A$1,0,0,COUNT($A:$A),1)").Select
    Range("=OFFSET($A$1,0,0,COUNT($A:$A),1)").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range( _
        "B1"), Unique:=True
    Range("=OFFSET($B$1,0,0,COUNT($B:$B),1)").Select
    Selection.Sort Key1:=Range("B1"), Order1:=xlAscending, Header:=xlGuess, _
        OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
        DataOption1:=xlSortNormal
End Sub

Where A is the column your data is in, and B is the column to copy and sort your data to.
 
Upvote 0
Jameo , thanks for the script, but is there a formula) as I am not an experienced script writer, I use record macros as a donk..
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,856
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top