Hi higgins
Welcome to the Forum!
If you wish this to be automated you'll need to define what's going to trigger the Code and the Code will need to be written in a Worksheet Change Event Macro.
If you wish to run the Code from a Button, place this Code in a General Module and assign the Code to the Button. Change the Sheet Name as indicated.
Option Explicit
Sub SortMe()
Dim ws As Worksheet
Dim LR As Long
Set ws = Sheets("Sheet1") '----<Change Steen Name as required
With ws
LR = .Cells.Find("*", .Cells(.Rows.Count, .Columns.Count), SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
.Sort.SortFields.Clear
.Sort.SortFields.Add Key:=Range("B2:B" & LR) _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ws.Sort
.SetRange Range("B1:H" & LR)
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End With
End Sub
I'd suggest you may wish to look at using a UserForm to automate this process.
Bookmarks