PDA

View Full Version : [SOLVED] sorting data by cell value



petroj02
11-08-2016, 04:48 AM
Hello,
Is it easily possible to sort data by value at column AK by this key via VBA?
before...



Column AK

Column AL

Column AM



Row3

33

Paul

P



Row4

12

Mike

M



Row5

25

George

G



after




Column AK

Column AL

Column AM



Row3

12

Mike

M



Row4

25

George

G



Row5

33

Paul

P




range of row 3 to 5 is just for ilustration. In real it start at row 3 and end with last row with data at column AK.

mana
11-08-2016, 05:29 AM
Sub test()

With Range("ak3", Range("ak" & Rows.Count).End(xlUp)).Resize(, 3)
.Sort .Columns(1), Header:=xlNo
End With

End Sub

petroj02
11-09-2016, 01:53 AM
Thank you Mana, this is great:-)