Private Sub psubシートの中の部分表の値を並び替え(ByRef shtTarget As Worksheet, _
ByVal plng並替開始Row As Long, _
ByVal pint並替開始Col As Integer, _
ByVal plng並替終了Row As Long, _
ByVal pint並替終了Col As Integer, _
ByVal pint並替順列Col As Integer)
If plng並替終了Row = 0 Then
plng並替終了Row = plngGetLastRow(shtTarget, pint並替順列Col)
End If
With shtTarget
.Select
.Sort.SortFields.Clear
.Sort.SortFields.Add Key:=.Range(.Cells(plng並替開始Row, pint並替順列Col), .Cells(plng並替開始Row, pint並替順列Col)), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With .Sort
.SetRange shtTarget.Range(shtTarget.Cells(plng並替開始Row, pint並替開始Col), shtTarget.Cells(plng並替終了Row, pint並替終了Col))
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End With
End Sub