Macro para agregar foto a usuario y contraseña

Para dante

Podrias ayudar con lo siguiente

Tengo archivo que quiero agregarle foto a usuario y contraseña. Ten envie el archivo y la explicacion de lo que requiero.

1 respuesta

Respuesta
2

Te anexo la primera parte para agregar usuarios y su imagen.

Private Sub CommandButton1_Click()
'Act.Por.Dante Amor
    Set b = Hoja6.Columns("A").Find(txt_nUser, lookat:=xlWhole)
    If Not b Is Nothing Then
        MsgBox "El usuario ya existe" & vbCr & "Ingrese un usuario diferente"
        txt_nUser.SetFocus
        Exit Sub
    End If
    '
    If txt_nUser = "" Then
        MsgBox "Escribe un usuario"
        txt_nUser.SetFocus
        Exit Sub
    End If
    '
    If txt_pass1 = "" Then
        MsgBox "Escribe una contraseña"
        txt_pass1.SetFocus
        Exit Sub
    End If
    '
    If txt_pass1 <> txt_pass2 Then
        MsgBox "Las contraseñas deben coincidir"
        txt_pass1.SetFocus
        Exit Sub
    End If
    '
    u = Hoja6.Range("A" & Rows.Count).End(xlUp).Row + 1
    If OptionButton1 Then nivel = "empleado" Else nivel = "Admin"
    Hoja6.Cells(u, "A") = txt_nUser
    Hoja6.Cells(u, "B") = Me.txt_pass1
    Hoja6.Cells(u, "C") = nivel
    Hoja6.Cells(u, "D") = Label4
    '-----------------------------------------------
    txt_nUser = ""
    txt_pass1 = ""
    txt_pass2 = ""
    Label4 = ""
    Image2.Picture = Nothing
    txt_nUser.SetFocus
    '
    MsgBox "Usuario Registrado"
End Sub
'
Private Sub CommandButton2_Click()
Unload Me
End Sub
'
Private Sub CommandButton3_Click()
    Dim ArchivoIMG As Variant
    Image2.Picture = Nothing
    ArchivoIMG = Application.GetOpenFilename("Imágenes jpg,*.jpg,Imágenes bmp,*.bmp", 0, "Seleccionar Imágen para Reegistro de Clientes")
    If ArchivoIMG = "Falso" Or ArchivoIMG = False Then Exit Sub
    Image2.Picture = LoadPicture(ArchivoIMG)
    Label4 = ArchivoIMG
End Sub
'
Private Sub UserForm_Initialize()
    Label4.Visible = False
End Sub
'S aludos. Dante Amor. Recuerda valorar la respuesta. G racias

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas