我實際上是自己做的:)現在我必須找出如何改變它,當有3個相同的..有人嗎?
Sub test()
Dim toAdd As Boolean, uniqueNumbers As Integer, i As Integer, j As Integer
Dim A$, B$
Cells(1, 4).Value = Cells(1, 1).Value
Cells(1, 5).Value = Cells(1, 2).Value
uniqueNumbers = 1
toAdd = True
For i = 2 To 30
For j = 1 To uniqueNumbers
If Cells(i, 1).Value = Cells(j, 4).Value Then
toAdd = False
A = Right(Cells(i, 2), 4)
B = Right(Cells(j, 2), 4)
Cells(j, 5).Value = A & "/" & B
End If
Next j
If toAdd = True Then
Cells(uniqueNumbers + 1, 4).Value = Cells(i, 1).Value
Cells(uniqueNumbers + 1, 5).Value = Cells(i, 2).Value
uniqueNumbers = uniqueNumbers + 1
End If
toAdd = True
Next i
End Sub
來源
2014-07-10 12:22:32
Wtr