Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub EqualArrays()
- Dim firstArr, secondArr As Variant
- firstArr = Array(10, 20, 30)
- secondArr = Array(10, 20, 40)
- Dim index As Integer
- Dim isIdentical As Boolean
- For i = 0 To UBound(firstArr)
- If firstArr(i) <> secondArr(i) Then
- isIdentical = False
- index = i
- Exit For
- Else
- isIdentical = True
- End If
- Next
- If isIdentical Then
- Debug.Print "Yes"
- Else
- Debug.Print "No - " & index
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement