Apply Macro/VBA to All Sheets Based on Multiple Sort Conditions

ashish002

New Member
Joined
Jul 5, 2021
Messages
23
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a excel with several tabs. I need to automate the sorting logic for all tabs.

Sorting order should be as follows:
1) Based on Highest Score - Column Name 'Score'
2) Based on Highest Change in Score - Column Name 'Change in Score'
3) If after doing the above 2 sorts there are 0s at the top in Previous N column then sort by column N (Highest to Lowest) then again by column Score (Highest to Lowest)
4) If there are no 0s after doing first 2 steps then no further step.

Column Position differs sometimes in every tab. That's one of the problems.

Is it possible to write any VBA for this? Let me know if any other details needed.
 

Attachments

  • SampleData.PNG
    SampleData.PNG
    45 KB · Views: 6

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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