Option Explicit
Sub procurarDados()
Dim i As Integer
Dim cont As Integer
cont = 0
For i = 1 To 6
If Plan1.Cells(1, i).Value = Plan2.Cells(1, i).Value Then
cont = cont + 1
End If
Next i
If cont = 6 Then
MsgBox "Valores idênticos"
End If
End Sub
Sub Verifica_se_intervalos_identicos()
Dim a, b As Variant, c As Boolean, i As Long, j As Long, X As String
X = "Há dados diferentes"
a = Range("A1:A10").Value
b = Range("B1:B10").Value
c = True
For i = LBound(a, 2) To UBound(b, 2)
For j = LBound(a, 1) To UBound(a, 1)
If Not a(j, i) = b(j, i) Then
c = False: Exit For
End If
Next j
If Not c Then Exit For
Next i
If c = False Then
MsgBox "Dados idênticos? : [ " & c & " ] " & X, vbCritical, "Saberexcel"
Else
MsgBox "Dados idênticos? : [ " & c & " ]", vbInformation, "Saberexcel"
End If
If Application.CountIf([a1:a10], 0) >= 1 Then MsgBox "Intervalo col(A) contém zero"
End Sub
Postado : 02/05/2018 9:07 am