excel怎么判断有相同数字并把不同数输出
展开全部
Sub ComplementarySet()
Dim Flag As Boolean, CS As String, i As Integer, j As Integer, k As Integer
For i = 1 To ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell).Row
CS = ""
For j = 1 To Len(CStr(Range("A" & i)))
Flag = True
For k = 1 To Len(CStr(Range("B" & i)))
If Mid(CStr(Range("A" & i)), j, 1) = Mid(CStr(Range("B" & i)), k, 1) Then
Flag = False
Exit For
End If
Next k
If Flag Then CS = CS + Mid(CStr(Range("A" & i)), j, 1)
Next j
Range("C" & i) = CS
Next i
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询