Sorting Data over several worksheets

PMRetired2012

Board Regular
Joined
Aug 6, 2019
Messages
123
I have a excel file that has 7 worksheets in it. I have a button set up that says Sort data. I want to be able to use one button (Sort Data) to sort data over those 7 sheets but each sheet be alphabetized by its self. Also i want the cells that are to be sorted on each sheet to be: A3:AL32 and A36:AL39.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Try:

Code:
Sub toSort1()

Dim ws As Worksheet
    For Each ws In Worksheets
        ws.Range("A3:AL32").Sort Key1:=ws.Range("A3"), Order1:=xlAscending, Header:=xlNo
        ws.Range("A36:AL39").Sort Key1:=ws.Range("A36"), Order1:=xlAscending, Header:=xlNo
    Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,504
Messages
6,114,020
Members
448,543
Latest member
MartinLarkin

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