Sort DATA T Count

sort in history sheet  be
 by the % column   descendant order

as show here
in the TRI-DATA Sheet
also im getting this message


here the file
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
I do not get that error.
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Please give this a try...
Sub SortHistoryData()
Dim lr As Long
Dim Rng As Range
lr = Cells(Rows.Count, 1).End(xlUp).Row
If lr < 4 Then
    MsgBox "No data to sort!", vbExclamation
    Exit Sub
End If
Set Rng = Range("A3:E" & lr)
Rng.Sort key1:=Range("C4"), order1:=xlDescending, Header:=xlYes
End Sub

Open in new window

Click the button called "Sort By %" on History Sheet to run the code.

The error you are getting because, you might have copied the button from another workbook but the macro underneath that button doesn't exists in the workbook.

Copy the code from the source workbook where this code worked and paste it on Standard Module of this workbook and then right click the button --> Choose Assign Macros and choose the macro from the available macro list and click OK. This would work then.
Martin LissOlder than dirtCommented:
No new button needed.
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

Subodh Tiwari (Neeraj)

Thanks for the fast response !  Great  ! Expert!

Martin LissOlder than dirtCommented:
If you already downloaded my workbook, please download it again. I made a small change.
Martin LissOlder than dirtCommented:
Mine already sorts properly.

i m getting this  when hot clean button fron TRI-DATA sheet

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Okay, try the attached file.
Martin LissOlder than dirtCommented:
Try this. Please note that when you copy data from one workbook to another it's important to put the data in the same place every time. In the case of this question, my code didn't clear properly because the data was not where it used to be.

Tenga en cuenta que cuando copia datos de un libro de trabajo a otro, es importante poner los datos en el mismo lugar cada vez. En el caso de esta pregunta, mi código no se borró correctamente porque los datos no estaban donde solía estar.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Great Job !!
Ever The  Best Experts !

 Martin Liss  ,  Subodh Tiwari (Neeraj)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Applications

From novice to tech pro — start learning today.