Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/02/2008, 02:17
matteomatico
 
Fecha de Ingreso: febrero-2008
Mensajes: 22
Antigüedad: 16 años, 3 meses
Puntos: 0
programacion con visual en excel

hola quisiera saber si me pueden ayudar con este codigo, el codigo me funciona es de ingreso de producto, el problema es que al ingresar se ingresa en la hoja 1 como puedo hacer para quie se ingrese en la hoja 2? ahi va el codigo haber si me echan una manito...



"Si cualquiera de los campos están vacíos no se ejecutará nada
Private Sub CmdIngresar_Click()
If CmbCod = Empty Or _
TxtBoleta = Empty Or _
TxtProducto = Empty Or _
TxtTipo_Precio = Empty Or _
TxtPrecio = Empty Or _
TxtVendedor = Empty Or _
TxtTipo_venta = Empty Or _
TxtCantidad = Empty Then
Exit Sub
End If
"De lo contrario seleccionamos la celda A2 para insertar el registro ahí
Range("A2").Select
"Insertar
Selection.EntireRow.Insert
"Llenamos las celdas con los valores introducidos en los campos
ActiveCell.Value = CmbCod
ActiveCell.Offset(0, 1).Value = Val(TxtBoleta)
ActiveCell.Offset(0, 2).Value = TxtProducto
ActiveCell.Offset(0, 3).Value = Val(TxtTipo_Precio)
ActiveCell.Offset(0, 4).Value = Val(TxtPrecio)
ActiveCell.Offset(0, 5).Value = TxtVendedor
ActiveCell.Offset(0, 6).Value = TxtTipo_venta
ActiveCell.Offset(0, 7).Value = Val(TxtCantidad)

"Vaciamos los datos
CmbCod = Empty
TxtBoleta = Empty
TxtProducto = Empty
TxtTipo_Precio = Empty
TxtPrecio = Empty
TxtVendedor = Empty
TxtTipo_venta = Empty
TxtCantidad = Empty

"Se "refresca" el listado del combobox
CmbCod.Clear
Sheets(1).Range("A1").Select
Do While ActiveCell <> Empty
ActiveCell.Offset(1, 0).Select
CmbCod.AddItem ActiveCell.Value
Loop

"Se posiciona el cursor sobre el Combobox
CmbCod.SetFocus

End Sub