Está en la página 1de 2

Hoja = Trim(InputBox("Nombre de hoja.

Si va a crear, presione <Intro>"))

If Len(Hoja) > 0 Then

Sheets(Hoja).Activate

Else

Sheets.Add

ActiveSheet.Name = "Tempo"

Cells(1, 26) = 1

Cells(1, 1) = "Producto"

Cells(1, 2) = "Precio"

Cells(1, 3) = "Cantidad"

Cells(1, 4) = "Monto"

Cells(1, 5) = "Fecha"

End If

FrmVentas.Show

End Sub

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

Alfredo Rico – RicoSoft - 2011 155


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 = ""

Alfredo Rico – RicoSoft - 2011 156

También podría gustarte