首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VBA >

怎么找出Excel一列中相同的值

2012-03-23 
如何找出Excel一列中相同的值如题[解决办法]上面错了这个Private Sub CommandButton1_Click()Dim j As Int

如何找出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

热点排行