ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

Comandos de Visual Basic en Excel


Enviado por   •  17 de Febrero de 2016  •  Apuntes  •  510 Palabras (3 Páginas)  •  339 Visitas

Página 1 de 3

Comandos de Visual Basic en Excel

Sheets (“principal”).Select

Sirve para regresar a menú anterior

        En evento = chick

        Caption= es el nombre

Me.hide

Comando para Salir del formulario

Botón para agragar datos

Private Sub CommandButton1_Click()

Dim fila As Integer

For fila = 2 To 1000

    If Hoja1.Cells(fila, 1) = "" Then

        Hoja1.Cells(fila, 1) = TextBox1.Text

        Hoja1.Cells(fila, 2) = TextBox2.Text

        Hoja1.Cells(fila, 3) = TextBox3.Text

        Hoja1.Cells(fila, 4) = TextBox4.Text

        Hoja1.Cells(fila, 5) = TextBox5.Text

        Hoja1.Cells(fila, 6) = TextBox6.Text

        Hoja1.Cells(fila, 7) = TextBox7.Text

        Hoja1.Cells(fila, 8) = (TextBox6.Text * TextBox7.Text) + 200

        Hoja1.Cells(fila, 9) = TextBox9.Text

         

         MsgBox "Su Producto a sido Ingresado"

        TextBox1.Text = ""      es lo mismo como decir TextBox1 = Empty

        TextBox2.Text = ""

        TextBox3.Text = ""

        TextBox4.Text = ""

        TextBox5.Text = ""

        TextBox6.Text = ""

        TextBox7.Text = ""

        TextBox8.Text = ""

        TextBox9.Text = ""

         

    Exit Sub

   

    End If

Next

End Sub

activesheet.cells(2, 1).Select

               

        activesheet.cells(2, 1) = TextBox1

        activesheet.cells(2, 2) = TextBox2

        activesheet.cells(2, 3) = TextBox3

        activesheet.cells(2, 4) = ComboBox1

        activesheet.cells(2, 5) = TextBox5

        activesheet.cells(2, 6) = (TextBox6 * TextBox5) + 200

        activesheet.cells(2, 7) = TextBox7

TextBox1.SetFocus

Comando para que el cursor se posicione en la primera casilla

Mensaje de error #N/A

Para eliminar este mensaje, en la casilla de formular se escribe =Si(A2”columna,fila”=””,””)

imagen = Range("2,8") & Range("2,1").Text & ".jpg"

  Image1.Picture = LoadPicture(imagen)

Para agregar imágenes

Sub ingresar()

    UserForm1.Show

   

End Sub

Nos sirve para que el botón ingrese al formulario

ComboBox

Para insertar un comboBox primero le damos un nombre al cuadro o lista que queremos agregar y después seleccionamos el cuadro de comboBox, buscamos en las opciones de propiedades y le damos el nombre del cuadro asignado en la opción RowSource

...

Descargar como (para miembros actualizados)  txt (2.3 Kb)   pdf (165.4 Kb)   docx (460.5 Kb)  
Leer 2 páginas más »
Disponible sólo en Clubensayos.com