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

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
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,214,403
Messages
6,119,308
Members
448,886
Latest member
GBCTeacher

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