ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sort help (https://www.excelbanter.com/excel-programming/276821-sort-help.html)

Richard Daniels

Sort help
 
Hi Todd

create a button on the sheet you want to sort, then add
this code to the click event

Private Sub CommandButton1_Click()
With CommandButton1.Parent
Range("c4:an4").Select
Selection.Sort Key1:=Range("C4"),
Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False,
Orientation:=xlLeftToRight, _
DataOption1:=xlSortNormal
End With
End Sub

Richard Daniels

-----Original Message-----
Ive got a worksheet with a table. On row 4 I have
different categorys. What is the code I would use for

it
to look in Row 4 starting with column C and sort
alphabetical? My data goes from column C to Column AN

in
row 4. I would like to have the code inserted into a
button so I can just click and it sort.

Thank you

Todd Huttenstine

.



All times are GMT +1. The time now is 10:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com