Data sort by VBA

Panoos64

Well-known Member
Joined
Mar 1, 2014
Messages
798
Hi to all of you, kindly require to provide me support so that a VBA code, should sort in an "ActiveSheet" its data used, which start from "A12" till column "K" and "rows down". Therefore that the rows arises to 800000+ and should be sort by col. "F". Thank you all in advance
 
Last edited:

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
33,489
Office Version
365
Platform
Windows
Is row 12 a header row that needs to stay put?
Also what column can be used to find the last row?
 

Panoos64

Well-known Member
Joined
Mar 1, 2014
Messages
798
Hi Fluff, row 12 is not header and should include in sort and column which should valid to find the last row should be "K". Thank you once again for your interesting to resolve my issue!
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
33,489
Office Version
365
Platform
Windows
Ok, how about
Code:
Sub Panoose()
    Range("A12", Range("K" & Rows.Count).End(xlUp)).Sort key1:=Range("F12"), order1:=xlAscending, Header:=xlNo
End Sub
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
33,489
Office Version
365
Platform
Windows
You're welcome & thanks for the feedback
 

Forum statistics

Threads
1,084,965
Messages
5,380,853
Members
401,702
Latest member
navyfan25

Some videos you may like

This Week's Hot Topics

Top