![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
Sub GetSameValue()
Dim arr(0)
Dim i As Integer, cellval As Integer, tempval As Integer
Dim varstr As String
arr(0) = Array(9, 1, 4, 6, 1, 1, 1, 1)
For i = 0 To UBound(arr(0))
cellval = arr(0)(i)
If i = 0 Then
tempval = cellval
Else
If cellval < tempval Then
tempval = cellval
varstr = i
ElseIf cellval = tempval Then
varstr = varstr & "," & i
End If
End If
Next i
Debug.Print varstr
End Sub