Experts Exchange connects you with the people and services you need so you can get back to work.
Private Sub Worksheet_BeforedoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim sortzone As Range, thisSheet As Worksheet
If Target.Column = 1 And Target.Row > 1 Then
Set thisSheet = ActiveWorkbook.ActiveSheet
Set sortzone = thisSheet.Range("A1").CurrentRegion.Offset(0, 1)
Set sortzone = sortzone.Resize(, sortzone.Columns.Count - 1)
thisSheet.Sort.SortFields.Add Key:=Target.Offset(0, 1).Resize(, sortzone.Columns.Count), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
.Header = xlNo
.MatchCase = False
.Orientation = xlLeftToRight
.SortMethod = xlPinYin
Cancel = True
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.