Sorting Data over several worksheets

PMRetired2012

New Member
Joined
Aug 6, 2019
Messages
31
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.
 

Akuini

Well-known Member
Joined
Feb 1, 2016
Messages
2,452
Office Version
365
Platform
Windows
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
 

Forum statistics

Threads
1,084,854
Messages
5,380,309
Members
401,662
Latest member
oct2019

Some videos you may like

This Week's Hot Topics

Top