Sort DATA T Count

sort in history sheet  be
 by the % column   descendant order

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

a10.PNG

here the file
29080402c--1-_T_select_all_sort_to_.xlsm
ADRIANA PACCOUNTING ASSISTANTAsked:
Who is Participating?
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.
1
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)
ActiveSheet.Sort.SortFields.Clear
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.
29080402c--1-_T_select_all_sort_to_.xlsm
1
Martin LissOlder than dirtCommented:
No new button needed.
29088191.xlsm
1
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

ADRIANA PACCOUNTING ASSISTANTAuthor Commented:
Subodh Tiwari (Neeraj)

Thanks for the fast response !  Great  ! Expert!

ddddd111111.PNG
0
Martin LissOlder than dirtCommented:
If you already downloaded my workbook, please download it again. I made a small change.
1
Martin LissOlder than dirtCommented:
Mine already sorts properly.
1
ADRIANA PACCOUNTING ASSISTANTAuthor Commented:
Martin

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

ee11111.PNG
0
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Okay, try the attached file.
29080402c--1-_T_select_all_sort_to_.xlsm
1
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.
29088191a.xlsm
1

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
ADRIANA PACCOUNTING ASSISTANTAuthor Commented:
Great Job !!
Ever The  Best Experts !

 Martin Liss  ,  Subodh Tiwari (Neeraj)
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.