Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Placing a Sort button on top of column
Message
Information générale
Forum:
Microsoft Office
Catégorie:
Excel
Divers
Thread ID:
00981427
Message ID:
00981488
Vues:
36
Missed the part about each column needing the button, so you would have to maybe hardcode the select range.
    Range("A4:BR44").Select
Then each buttons macro would have a different Key1 in the sort.


>You'll have to add a button and assign it to a macro.
>
>The macro would go something like this:
>
>Sub SortRows()
>    'Select the entire row, so the number of columns does not matter
>    'In this example we're assuming the data starts on row 4
>    Rows("4:4").Select
>
>    'Go down to the end of the data.
>    'This macro also assumes that something in in
>    'every cell in column A.
>    'This makes it so that the number of rows does not matter.
>    'If you don't like the grabbing of the entire row and jumping down,
>    'you could select a range in the select
>    'statement before this instead
>    Range(Selection, Selection.End(xlDown)).Select
>
>    'We're also sorting on column A
>    Selection.Sort Key1:=Range("A4"), Order1:=xlAscending, Header:=xlNo, _
>        OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
>        DataOption1:=xlSortNormal
>
>    'Unhighlight all those cells you selected earlier
>    Range("A4").Select
>End Sub
>
>
>HTH
>
>
>>I have a spreadsheet with 40 rows and 70 columns.
>>I would like to place a button on the row before the header of each row that when I click on it it sorts that column.
>>How can I do that?
>>
>>Thanks in advance
>>Raymond
___________________________
Kenneth Wonderley
http://www.wonderley.com


...the fruit of the Spirit is love, joy, peace, patience, kindness, goodness, faithfulness, gentleness and self-control.
Galatians 5:22 & 23
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform