Conferencia
[pic]
USERFORM1
[pic]
BOTON INGRESAR
Private Sub CommandButton1_Click()
If TextBox1.Text "" Then
Range("A9").Select
Selection.EntireRow.Insert
Rem ubicarse elcurso en la celda A9
Range("A9").Select
Rem insertamos el texto de textobox1 en A9
ActiveCell.FormulaR1C1 = TextBox1
Rem repetimos cn textbox2 y textbox3
Range("B9").SelectActiveCell.FormulaR1C1 = Val(TextBox2)
Range("C9").Select
ActiveCell.FormulaR1C1 = Val(TextBox3)
Rem ubicamos el cruso en la celda A9
Range("D9").Select
ActiveCell.FormulaR1C1 = Val(TextBox2) * Val(TextBox3)Rem Empty limpiamos los Textbox
TextBox1 = Empty
TextBox2 = Empty
TextBox3 = Empty
Rem TextBox1.SetFocus ponemos el cursor en TextBox1
Rem para volver a capturar los datos
Else
MsgBox"Escriba un producto"
End If
TextBox1.SetFocus
End Sub
BOTON CANCELAR
Private Sub CommandButton2_Click()
Rem Oculta el formulario
UserForm1.Hide
End Sub
BOTON EN EXCEL DE (INSERTAR DATOS)
Private Sub CommandButton1_Click()
Rem permite ver en pantalla el formulario
UserForm1.Show
End Sub
[pic]
BOTÓN DE BUSCAR
Private Sub CommandButton1_Click()
WithWorksheets(1).Range("a1:a65536")
Set c = .Find(What:=TextBox1, LookIn:=xlFormulas)
If Not c Is Nothing Then
Range(c.Address).Select
Else
MsgBox "Ese registro no existe"
End If
Setc = Nothing
End With
End Sub
BOTÓN DE ELIMINAR
Private Sub CommandButton2_Click()
Selection.EntireRow.Delete
End Sub
BOTÓN DE CERRAR
Private Sub CommandButton3_Click()
UserForm2.HideEnd Sub
BOTÓN DE EXCEL (BORRAR DATOS )
Private Sub CommandButton2_Click()
UserForm2.Show
End Sub
[pic]
BOTÓN DE BUSCAR
Private Sub CommandButton1_Click()
WithWorksheets(1).Range("a1:a65536")
Set c = .Find(What:=TextBox1, LookIn:=xlFormulas)
If Not c Is Nothing Then
Range(c.Address).Select
CommandButton2.Enabled = True
Else
MsgBox "Ese registro no existe"...
Regístrate para leer el documento completo.