Sub uriage()
Range("I4").Select 'I4セルをセレクト
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Clear '前のSortFieldオブジェクト削除
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range("I4"), _
SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Sheet1").Sort
.SetRange Range("A3:I8")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
More than 3 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme