Auto sorting (based on) one column

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to make a spreadsheet automatically sort (based on an alpha listing in one column) without highlighting the whole sheet and doing "data" "sort" "column A" etc?
 
i have done something like this using VBA. if you dont mind macros, yo
could use something like this:

Sheet#.Select
Selection.AutoFilter Field:=1, Criteria1:="criteria
 
Just a suggestion. I wouldn't make it automatic. I would think that it would
make data entry a problem. You type something in A12345 and hit enter. Next
thing you know, it's moved off the screen and you have to go search for it.

But what I would do is put a button from the Forms toolbar on the worksheet (row
1 with Windows|freeze panes set to always show row 1).

Assign it a macro that does the sort.

something like:

Option Explicit
Sub testme01()
With ActiveSheet
.Range("a1:K" & .Cells(.Rows.Count, "A").End(xlUp).Row).Sort _
Key1:=.Range("A1"), Order1:=xlAscending, _
Header:=xlYes, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End With
End Sub

I used column A to determine the number of rows to sort and went from column A
to column K.

And I only had one header row (row 1).

With this approach, you can enter a few rows and then sort when you want.
 
Back
Top