Unidad 7. Aplicaciones (VI)



Dim Hoja As Variant

Private Sub CboProductos_Change()

TxtProducto.Text = CboProductos.List(CboProductos.ListIndex)

TxtPrecio.Text = Sheets("Productos").Cells(CboProductos.ListIndex + 2, 2)

End Sub

Private Sub CmdFin_Click()

End

End Sub

Private Sub CmdLoad_Click()

Hoja = ActiveSheet.Name

Sheets("Productos").Activate

iFila = 2

Cadena = Trim(Cells(iFila, 1))

While Len(Trim(Cadena)) > 0

    CboProductos.AddItem Cadena

    iFila = iFila + 1

    Cadena = Trim(Cells(iFila, 1))

Wend

End Sub

Private Sub CmdTransf_Click()

Sheets(Hoja).Select

Ix = Cells(1, 26)

Ix = Ix + 1

Cells(Ix, 1) = TxtProducto.Text

Cells(Ix, 2) = TxtPrecio.Text

Cells(Ix, 3) = TxtCantidad.Text

Cells(Ix, 4) = TxtMonto.Text

Cells(Ix, 5) = TxtFecha.Text

Cells(1, 26) = Ix

TxtProducto.Text = ""

TxtPrecio.Text = ""

TxtCantidad.Text = ""

TxtMonto.Text = ""

TxtFecha.Text = ""

End Sub

Private Sub TxtCantidad_Change()

TxtMonto.Text = Val(TxtCantidad.Text) * Val(TxtPrecio.Text)

TxtFecha.Text = Date

End Sub

Private Sub TxtPrecio_Change()

TxtCantidad.SetFocus

End Sub

Noviembre-2010
Pág. 7.6

Atrás  Inicio    





Página inicial  Cursos Informática Gratuitos

Síguenos en:   Facebook       Sobre aulaClic            Política de Cookies