|
Private Sub Worksheet_Change(ByVal Target As Range)
Dim arr, Wb As Workbook, Sht As Worksheet
If Target.Column = 4 Then
If Target = 1 Then
Sheet2.Copy
Set Wb = ActiveWorkbook
Set Sht = Wb.ActiveSheet
Sht.Name = "A"
With Sht
arr = Range("A1:B3")
.Range("a2").Resize(3, 2) = arr
.ListObjects("表1").Sort.SortFields.Add2 Key:=Sht.Range("表1[[#All],[年龄]]"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With .ListObjects("表1").Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
.ListObjects("表1").Sort.SortFields.Clear
End With
End If
End If
End Sub
|
评分
-
1
查看全部评分
-
|