| 
    
     |  | こんな感じでできるのでは・・・ 
 シートの状態
 a    b
 1 項目1
 2 数字
 3 数字
 4 数字
 :
 :数字とa
 :数字とb
 
 こんなレイアウトかと思いますが・・・
 b列をマクロの作業列として使いますが(邪魔だったら他の作業列を使って
 ください)
 マクロの基本は数字に全て「0」をつけていきます。
 5aは50です、5bも50です。
 そしてB列でソート掛けて、B列削除・・・
 
 Dim LastCell As Range
 Dim c As Range
 Dim cntBumon As Integer
 cntBumon = Range("A1", Cells(1, Cells.Columns.Count).End(xlToLeft)).Columns.Count
 
 Set LastCell = Cells(Cells.Rows.Count, 1).End(xlUp)
 For Each c In Range("A2", LastCell)
 If Right(c.Value, 1) = "a" Or Right(c.Value, 1) = "b" Then
 c.Offset(, cntBumon).Value = Mid(c.Value, 1, Len(c.Value) - 1) & "0"
 
 Else
 c.Offset(, cntBumon).Value = c.Value & "1"
 End If
 Next
 Range("A1", LastCell).Resize(, cntBumon + 1).Sort Key1:=Cells(2, cntBumon + 1), Order1:=xlAscending, Header:= _
 xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
 SortMethod:=xlPinYin
 Range("A1", LastCell).Offset(, cntBumon).ClearContents
 
 
 
 
 
 |  |