怎么找出Excel一列中相同的值
如何找出Excel一列中相同的值
如题
------解决方案--------------------
上面错了
这个
Private Sub CommandButton1_Click()
Dim j As Integer
Dim m As Integer
Dim i As Integer
j = 1
m = 2
For i = 1 To 20
For j = 1 To 20
If Sheet1.Cells(i, 3).Text = Sheet1.Cells(j, 3).Text Then
Cells(j, 3).Interior.ColorIndex = m + 1
Cells(i, 3).Interior.ColorIndex = m + 1
End If
Next j
If Sheet1.Cells(i, 3).Text = "" Then
GoTo mex
End If
m = m + 1
Next i
mex:
End Sub
如题
------解决方案--------------------
上面错了
这个
Private Sub CommandButton1_Click()
Dim j As Integer
Dim m As Integer
Dim i As Integer
j = 1
m = 2
For i = 1 To 20
For j = 1 To 20
If Sheet1.Cells(i, 3).Text = Sheet1.Cells(j, 3).Text Then
Cells(j, 3).Interior.ColorIndex = m + 1
Cells(i, 3).Interior.ColorIndex = m + 1
End If
Next j
If Sheet1.Cells(i, 3).Text = "" Then
GoTo mex
End If
m = m + 1
Next i
mex:
End Sub