Guest User

Untitled

a guest
Jan 16th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. Function verifica_cpf(cpf As Integer) As Boolean
  2.  
  3. Dim i As Integer, intValueToFind As Long, x As Boolean
  4. cpf = False
  5.  
  6. intValueToFind = Range("i3").Value
  7.  
  8. Sheets("Banco de Dados").Select
  9. NumRows = Range("A2", Range("A2").End(xlDown)).Rows.Count
  10.  
  11. For i = 3 To NumRows
  12. If Cells(i, 1).Value = intValueToFind Then
  13. MsgBox ("CPF já cadastrado na linha " & i & vbNewLine & "Dados não inseridos no banco")
  14. x = True
  15. End If
  16. Next i
  17.  
  18. Return cpf ' Esta linha apresenta o erro de "fim de instrução esperado" ao compilar
  19.  
  20. End Function
  21.  
  22. Private Sub Cadastrar()
  23.  
  24. Sheets("Cadastrar").Select
  25.  
  26. Dim cpf = verifica_cpf() ' Esta linha apresenta o erro de "fim de instrução esperado" ao compilar
  27. .
  28. .
  29. .
  30. end sub
Add Comment
Please, Sign In to add comment