|
谢谢,按这个贴子又做了一遍题。
- Private Sub deldeldeldeldel()
- Dim Sht As Worksheet, Rng As Range, oRng As Range
- Set Sht = Sheet2
- Sht.Activate
- Set Rng = Sht.Cells(20, 3).CurrentRegion
- Set Rng = Rng.Resize(Rng.Rows.Count, Rng.Columns.Count + 5)
- Debug.Print Rng.Address
-
- Debug.Print Rng(, 5).Resize(Rng.Rows.Count, 1).Address
- Set oRng = Rng(, 5).Resize(Rng.Rows.Count, 1)
- Sht.Sort.SortFields.Clear
- Sht.Sort.SortFields.Add Key:=Range(oRng.Address) _
- , SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
- xlSortNormal
- With Sht.Sort
- .SetRange Range(Rng.Address)
- .Header = xlGuess ' = xlYes
- .Apply
- End With
-
-
-
-
- End Sub
复制代码
|
|