Sort need by macro

Boris7265

Board Regular
Joined
Apr 6, 2011
Messages
68
Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
I have hope that somebody will help me with this.<o:p></o:p>
<o:p></o:p>
I have very large spreadsheet that has been populated out from Access query -around 15000-20000 rows .I need to sort this spreadsheets by column M in order to work with it , but the spreadsheet must be highlight all from column A thru up to column W (Column W is the last row in the spreadsheet) and the all columns should be sorted accordingly as column M is sorted . I know that I can do it right in the file , but the problem is that the file is large and there are many users are working with the spreadsheet so I have gotten the task to program it due to many human mistakes . <o:p></o:p>
Thank you for any input and greatly appreciates your help.<o:p></o:p>
The Best Reagrds.<o:p></o:p>
.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Try

Code:
Sub srt()
ActiveSheet.UsedRange.Sort Key1:=Range("M2"), Order1:=xlAscending, _
        Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub
 
Upvote 0
Hi Smitty and VoG,

The problem is the the queiry is sorted in Access and it is arangment is right , but during the transferring to Excel file via VB code the datas have been uploaded not sorted . So far , we sort in Excel file until , we find out why the file uploaded not sorted eventhought it is correct in Access . The db is located on the share drive and it is bieng used hevily by many people , therefore there are not much time to look into vb code of db and work with it .So, the working macro in the spreadsheet so far better workingable solution rigth now.

I tried macro that Vog provied in the second post and it works nicely .So far I am going to use that macro provied by Vog , until I find out the problem with transferring Access into Excel.

Thank you very much for you help and time .

The Best Regards.
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,716
Members
452,939
Latest member
WCrawford

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