Quantcast
Viewing latest article 5
Browse Latest Browse All 5

"If And Then" não funciona

boa noite

tentei adaptar o codigo abaixo para a planilha, mais nao funciona, mesmo as 2 condicoes sendo verdadeiras.

Dim lngRowsCount As Long
    For lngRowsCount = Cells(Rows.Count, "C").End(xlUp).Row To 2 Step -1
      If ((Cells(lngRowsCount, "A") = TxtCadastro.Value) And (Cells(lngRowsCount, "B") = TxtNome.Value)) Then
        If Cells(lngRowsCount, "C") = "Admitido" Then
            Cells(lngRowsCount, "C") = "Admitido>"
        End If
       End If
    Next lngRowsCount

detalhe: usando o "or" o codigo aceiita

obrigado


Viewing latest article 5
Browse Latest Browse All 5

Trending Articles