Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function verifica_cpf(cpf As Integer) As Boolean
- Dim i As Integer, intValueToFind As Long, x As Boolean
- cpf = False
- intValueToFind = Range("i3").Value
- Sheets("Banco de Dados").Select
- NumRows = Range("A2", Range("A2").End(xlDown)).Rows.Count
- For i = 3 To NumRows
- If Cells(i, 1).Value = intValueToFind Then
- MsgBox ("CPF já cadastrado na linha " & i & vbNewLine & "Dados não inseridos no banco")
- x = True
- End If
- Next i
- Return cpf ' Esta linha apresenta o erro de "fim de instrução esperado" ao compilar
- End Function
- Private Sub Cadastrar()
- Sheets("Cadastrar").Select
- Dim cpf = verifica_cpf() ' Esta linha apresenta o erro de "fim de instrução esperado" ao compilar
- .
- .
- .
- end sub
Add Comment
Please, Sign In to add comment