Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
Por efaraujo
#71397
Pessoal ,
Boa tarde

Estou criando uma macro de login e senha , porém esta dando erro de argumentação e não onde estou falhando nos argumentos

Private Sub cmdEntrar_Click() - Aqui esta depurando o erro

If txtlogin = "" Then
MsgBox "Digite o nome do usuário !"
Exit Sub
txtlogin.SetFocus
Else
If txtsenha = "" Then
MsgBox "Digite a senha do usuário !"
Exit Sub
txtsenha.SetFocus
End If

col = 1
lin = 2
While (User.Cells(lin, col) <> txtlogin)
lin = lin + 1
If lin > 50 Then
MsgBox "Usuário não esta cadastrado"
Exit Sub
End If

Wend

Dim senha As String
col = 2
senha = User.Cells(lin, col).Value

If txtsenha <> senha Then
MsgBox "A senha não confere !!"
Exit Sub
Else
MsgBox "Seja Bem Vindo " & txtlogin
lin = 2
col = 1
While (Log.Cells(lin, col) <> "")
lin = lin + 1
Wend
Log.Cells(lin, 1) = txtlogin.Value
Log.Cells(lin, 2) = txtsenha.Value
Log.Cells(lin, 3) = Date
Motorista.Visible = xlSheetVisible
Sheets("Motorista").Activate
ActiveWindow.DisplayWorkbookTabs = False
Hide

End If

End Sub
Imagem
Imagem
Por osvaldomp
#71399
Olá, @efaraujo .

Sugestão: disponibilize diretamente aqui no fórum uma amostra do seu arquivo Excel.
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord