Un favor me puedes ayudar en la correcion de este libro de vba
lleno el formulario pero en el promedio me sale 0 no un resultado como se ve en las imagenes.
Sale en el 2 un mensaje de error 424
cuando veo en depurar sale una linea amarilla y no se en que falle.
ELSE
y una pregunta despues quiero darle una condicion si de la respuesta que me da el promedio si es bueno regular o malo donde lo pondria gracias!
Adjunto | Tamaño |
---|---|
codigo02.png | 154.78 KB |
1.jpg | 54.23 KB |
2.jpg | 9.89 KB |
3.jpg | 130.54 KB |
codigo01.png | 155.21 KB |
------
Ya sé Excel, pero necesito más.
Private Sub NOMBRE_Change()
Sub IngresarInformacion()
Dim n As Long
Dim PROM As Double
Hoja1.Select
PROM = (Val(FRMINGRESODATOS.TXTNOTA1) + Val(FRMINGRESODATOS.TXTNOTA2) + Val(FRMINGRESODATOS.TXTNOTA3) + Val(FRMINGRESODATOS.TXTNOTA4)) / 4
n = 4
Do While (Cells(n, 2) <> Empty Or Cells(n, 3) <> Empty Or Cells(n, 4) <> Empty Or Cells(n, 5) <> Empty Or Cells(n, 6) <> Empty Or Cells(n, 7) <> Empty Or Cells(n, 11) <> Empty Or Cells(n, 12) <> Empty Or Cells(n, 13) <> Empty Or Cells(n, 14) <> Empty Or Cells(n, 15) <> Empty)
n = n + 1
Loop
If (FRMINGRESODATOS.rbtSI.Value = True Or FRMINGRESODATOS.rbtNO.Value = True) Then
Cells(n, 2).Value = FRMINGRESODATOS.TXTAPELLIDOS.Text
Cells(n, 3).Value = FRMINGRESODATOS.NOMBRE.Text
Cells(n, 4).Value = FRMINGRESODATOS.TXTEDAD.Text
Cells(n, 5).Value = FRMINGRESODATOS.TXTDNI.Text
Cells(n, 6).Value = FRMINGRESODATOS.TXTPAIS.Text
Cells(n, 7).Value = FRMINGRESODATOS.TXTDIRECCION.Text
Cells(n, 11).Value = FRMINGRESODATOS.TXTNOTA1.Text
Cells(n, 12).Value = FRMINGRESODATOS.TXTNOTA2.Text
Cells(n, 13).Value = FRMINGRESODATOS.TXTNOTA3.Text
Cells(n, 14).Value = FRMINGRESODATOS.TXTNOTA4.Text
Cells(n, 15).Value = PROM
If FRMINGRESODATOS.rbtSI.Value = True Then
Cells(n, 8).Value = "SI"
FRMINGRESODATOS.rbtSI.Value = False
Else
If FRMINGRESODATOS.rbtNO.Value = True Then
Cells(n, 8).Value = "NO"
FRMINGRESODATOS.rbtNO.Value = False
End If
End If
If (FRMINGRESODATOS.rbtM.Value = True Or FRMINGRESODATOS.rbtF.Value = True) Then
If FRMINGRESODATOS.rbtM.Value = True Then
Cells(n, 9).Value = "Masculino"
FRMINGRESODATOS.rbtM.Value = False
Else
If FRMINGRESODATOS.rbtF.Value = True Then
Cells(n, 9).Value = "Femenino"
FRMINGRESODATOS.rbtF.Value = False
End If
End If
If (FRMINGRESODATOS.OptionButton1.Value = True Or FRMINGRESODATOS.OptionButton2.Value = True) Then
If FRMINGRESODATOS.OptionButton1.Value = True Then
Cells(n, 10).Value = "SI"
FRMINGRESODATOS.OptionButton1.Value = False
Else
If FRMINGRESODATOS.OptionButton2.Value = True Then
Cells(n, 10).Value = "NO"
FRMINGRESODATOS.OptionButton2.Value = False
End If
End If
FRMINGRESODATOS.TXTAPELLIDOS.Text = ""
FRMINGRESODATOS.NOMBRE.Text = ""
FRMINGRESODATOS.TXTEDAD.Text = ""
FRMINGRESODATOS.TXTDNI.Text = ""
FRMINGRESODATOS.TXTPAIS.Text = ""
FRMINGRESODATOS.TXTDIRECCION.Text = ""
FRMINGRESODATOS.TXTNOTA1.Text = ""
FRMINGRESODATOS.TXTNOTA2.Text = ""
FRMINGRESODATOS.TXTNOTA3.Text = ""
FRMINGRESODATOS.TXTNOTA4.Text = ""
FRMINGRESODATOS.foto.Picture = Nothing
MsgBox "Ha ingresado un registro con éxito en la fila número " & n & ".", vbInformation + vbOKOnly, "Información de registro."
FRMINGRESODATOS.TXTAPELLIDOS.SetFocus
Else
MsgBox "Debe seleccionar una opción." & vbCrLf & "Para el trabajo actual", vbCritical + vbOKOnly, "Alerta..."
End If
End If
End If
End Sub
-----
Esta duda fue enviada por email a través de la página de contacto del sitio.
Se plantea en el foro a través de esta cuenta de usuario genérica para hacerela pública,
por si puede ser de ayuda a alguien más.
------
Ya sé Excel, pero necesito más.
-----
Esta duda fue enviada por email a través de la página de contacto del sitio.
Se plantea en el foro a través de esta cuenta de usuario genérica para hacerela pública,
por si puede ser de ayuda a alguien más.
Hola Víctor:
------
Ya sé Excel, pero necesito más.
Aqui parece que la libreria referente a picture no la esta reconociendo, ¿porque? talves la tengas en Windows/system32 o Windows syswow64 segun la plataforma que tengas de SO
Si tu plataforma de Windows es la que sea 86 o 64, esta bien pero si TU OFFICE ES X64 tienes problemas una ves que este no reconoce las librerias que no son nativas de office 2010-2013.
aunque las tyengas registradas en su directorio adcuado.
Tienes que tener la plataforma x86 de office para que te las reconozca. Ahi lo que te esta diciendo es que ol objecto Picture no existe