Public Sub Organize()
On Error Resume Next
ThisWorkbook.Worksheets("Expense").Sort.SortFields.Clear
ThisWorkbook.Worksheets("Income").Sort.SortFields.Clear
ThisWorkbook.Worksheets("Summary").Sort.SortFields.Clear
ThisWorkbook.Worksheets("Expense").Range("ExpenseData").Sort Key1:=Range("A2"), Key2:=Range("B2"), Key3:=Range("C2"), Order1:=xlAscending, Order2:=xlAscending, Order3:=xlAscending
ThisWorkbook.Worksheets("Income").Range("IncomeData").Sort Key1:=Range("A2"), Key2:=Range("B2"), Key3:=Range("C2"), Order1:=xlAscending, Order2:=xlAscending, Order3:=xlAscending
ThisWorkbook.Worksheets("Summary").Range("SummaryData").Sort Key1:=Range("A2"), Key2:=Range("C2"), Order1:=xlAscending, Order2:=xlAscending
On Error GoTo 0
End Sub
This is my code and I want it to run on every page simultaneously when I hit the button that has assigned macro. Currently I have to go to each sheets to make this macro work. I would love to receive some advices.
On Error Resume Next
ThisWorkbook.Worksheets("Expense").Sort.SortFields.Clear
ThisWorkbook.Worksheets("Income").Sort.SortFields.Clear
ThisWorkbook.Worksheets("Summary").Sort.SortFields.Clear
ThisWorkbook.Worksheets("Expense").Range("ExpenseData").Sort Key1:=Range("A2"), Key2:=Range("B2"), Key3:=Range("C2"), Order1:=xlAscending, Order2:=xlAscending, Order3:=xlAscending
ThisWorkbook.Worksheets("Income").Range("IncomeData").Sort Key1:=Range("A2"), Key2:=Range("B2"), Key3:=Range("C2"), Order1:=xlAscending, Order2:=xlAscending, Order3:=xlAscending
ThisWorkbook.Worksheets("Summary").Range("SummaryData").Sort Key1:=Range("A2"), Key2:=Range("C2"), Order1:=xlAscending, Order2:=xlAscending
On Error GoTo 0
End Sub
This is my code and I want it to run on every page simultaneously when I hit the button that has assigned macro. Currently I have to go to each sheets to make this macro work. I would love to receive some advices.