Sort fields in the current selection

88rizer

New Member
Joined
May 25, 2013
Messages
6
I would like a macro to sort fields in the current selection ( selected before running macro). tks
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Re: 88rizer

Try this:
Code:
Sub Sort_Me()
'Modified 4/28/2019 3:25:03 PM  EDT
Application.ScreenUpdating = False
Selection.Sort key1:=Selection, order1:=xlAscending, Header:=xlNo
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Re: 88rizer

I thought the thread Title was:
Sort fields in the current selection
 
Upvote 0
Re: 88rizer

Have a look at the headings for the last 3 posts. I changed the title after posting...
 
Last edited:
Upvote 0
Re: Sort mulltiple fields in the current range (selected prior to running macro)

"I would like a macro to sort multiple fields in the current range selection ( selected before running macro). tks
range can be between c8:j350.
I am tryling to sort checks, deposits and dates for each month out of a years spread sheet.
 
Upvote 0
Re: Sort mulltiple fields in the current range (selected prior to running macro)

I suggest you try using the Macro recorder. You have not provided specific details.

Like how to sort. What column in the selection is the range sorted by

And you earlier said selection you did not mention specific range

See you have to tell the script which column in selection to sort by.

I have no way of knowing.

Try using the Macro recorder to do your sorting then Modify it to your needs if you plan to change the selection each time
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,868
Members
449,054
Latest member
juliecooper255

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