Hi Fellow Excel lovers,
I have this problem on sorting, that needs direct help, I'm not that good with all the functions. See below
Private Sub Worksheet_Change(ByVal Target As Range)
Dim arearow As Excel.Range
Dim ACell As Range
Dim ActiveCellInTable As Boolean
Dim r As Single
Dim Value As Variant
Set ACell = Target
On Error Resume Next
ActiveCellInTable = (ACell.ListObject.Name = "Table3")
On Error GoTo 0
If ActiveCellInTable = True Then
r = Target.Row - Target.ListObject.Range.Row + 1
For c = 1 To ActiveSheet.ListObjects(ACell.ListObject.Name).Range.Columns.Count
If ActiveSheet.ListObjects(ACell.ListObject.Name).Range.Cells(r, c).Value = "" Then Exit Sub '
'how to trigger a row change not an empty cell in a row to process a sort function below?
Next c
With ActiveSheet.ListObjects(ACell.ListObject.Name).Sort
.SortFields.Clear
.SortFields.Add _
Key:=Range("Table3[[#All],[Column2]]"), SortOn:=xlSortOnValues, Order _
:=xlAscending, DataOption:=xlSortNormal
.Apply
End With
End If
End Sub
Thanks,
Bookmarks