Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim i As Long
If Not Intersect(ActiveCell, Range("Situations")) Is Nothing Then
Range("Situation").Value = ActiveCell.Value
ElseIf Not Intersect(ActiveCell, Range("Hands")) Is Nothing Then
For i = 1 To 4
If Range("Card" & i).Value = "" Then
Range("Card" & i).Value = ActiveCell.Value
Exit For
End If
Next i
ElseIf Not Intersect(ActiveCell, Range("Reset")) Is Nothing Then
Range("I16:M16").ClearContents
End If
ActiveWorkbook.Worksheets("Output").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Output").Sort.SortFields.Add Key:=Range("T1:T4"), _
SortOn:=xlSortOnValues, Order:=xlAscending, CustomOrder:= _
"Ac,Kc,Qc,Jc,Tc,9c,8c,7c,6c,5c,4c,3c,2c,Ad,Kd,Qd,Jd,Td,9d,8d,7d,6d,5d,4d,3d,2d,Ah,Kh,Qh,Jh,Th,9h,8h,7h,6h,5h,4h,3h,2h,As,Ks,Qs,Js,Ts,9s,8s,7s,6s,5s,4s,3s,2s" _
, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Output").Sort
.SetRange Range("T1:T4")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Bookmarks