![]() |
automatic sorting
can somebody pse help me out?
how can I automate the sorting (in ascending or desc. order) columnA (variable lenght) containing mixed multiple text and/or number values (even blank ones) so, that in colF will be the sorted list of unique values and colG will show how many times this value figures in the unsorted list many thanks in advance |
automatic sorting
Put this in your workbook and create a button that calls it.
'/======================================/ Sub MySort() Selection.Sort _ Key1:=Range("F2"), Order1:=xlAscending, _ Key2:=Range("G2"), Order2:=xlAscending, _ Header:=xlYes, OrderCustom:=1, _ MatchCase:=False, Orientation:=xlTopToBottom End Sub '/======================================/ HTH, -- Gary Brown If this post was helpful, please click the ''Yes'' button next to ''Was this Post Helpfull to you?''. "gmisi" wrote: can somebody pse help me out? how can I automate the sorting (in ascending or desc. order) columnA (variable lenght) containing mixed multiple text and/or number values (even blank ones) so, that in colF will be the sorted list of unique values and colG will show how many times this value figures in the unsorted list many thanks in advance |
automatic sorting
Hi Gary,
I do thank you for the suggestion, but my weakness in VBA won't let me out from the 400 error (I created the button, pasted the code, saved, selected column A3:A100 to sort, used the button and got the error400). Can you pse advise how to proceed further? I wonder is there any worksheet function combination to accomplish this task?Can anybody help with this? Thx "Gary L Brown" wrote: Put this in your workbook and create a button that calls it. '/======================================/ Sub MySort() Selection.Sort _ Key1:=Range("F2"), Order1:=xlAscending, _ Key2:=Range("G2"), Order2:=xlAscending, _ Header:=xlYes, OrderCustom:=1, _ MatchCase:=False, Orientation:=xlTopToBottom End Sub '/======================================/ HTH, -- Gary Brown If this post was helpful, please click the ''Yes'' button next to ''Was this Post Helpfull to you?''. "gmisi" wrote: can somebody pse help me out? how can I automate the sorting (in ascending or desc. order) columnA (variable lenght) containing mixed multiple text and/or number values (even blank ones) so, that in colF will be the sorted list of unique values and colG will show how many times this value figures in the unsorted list many thanks in advance |
automatic sorting
Hi Gary,
I do thank you for your suggestion, but my weakness in VBA trapped me (I created the button, pasted the code, saved the workbook, selected the A3:A110 to be sorted, but the error400 keeps coming up. Can you pse advise, how to proceed further. I wonder, is there any combination of worksheet functions to accomplish this task? Thx "Gary L Brown" wrote: Put this in your workbook and create a button that calls it. '/======================================/ Sub MySort() Selection.Sort _ Key1:=Range("F2"), Order1:=xlAscending, _ Key2:=Range("G2"), Order2:=xlAscending, _ Header:=xlYes, OrderCustom:=1, _ MatchCase:=False, Orientation:=xlTopToBottom End Sub '/======================================/ HTH, -- Gary Brown If this post was helpful, please click the ''Yes'' button next to ''Was this Post Helpfull to you?''. "gmisi" wrote: can somebody pse help me out? how can I automate the sorting (in ascending or desc. order) columnA (variable lenght) containing mixed multiple text and/or number values (even blank ones) so, that in colF will be the sorted list of unique values and colG will show how many times this value figures in the unsorted list many thanks in advance |
All times are GMT +1. The time now is 12:09 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com