Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Sub BUSCARARTICULOS()
Buscar_Articulos.Show
End Sub
Application.ScreenUpdating = False
Range("B5").Select 'Celda donde empieza el rango de los articulos que se van a extraer
While ActiveCell.Value <> "" And ActiveCell.Value <> Val(L) And ActiveCell.Value <> L
ActiveCell.Offset(1, 0).Select
Wend
Else
NOMB1 = ActiveCell.Value
If DON = "FACTURA" Then 'el texto entre comillas debe ser igual al de la hoja que se pegara la
información y tambien debe colocarce talcual en la celda A1 de la hoja que se abrira el userform
Wend
ActiveCell.Value = NOMB1
End If
End If
Unload Me
End If
ERR1:
Application.ScreenUpdating = True
End Sub
If M > 0 Then
'Remplazar LISTA_ARTICULOS por el Name del cuadro de lista que usted tiene
LISTA_ARTICULOS.AddItem
ActiveCell.Offset(0, 1).Select
LISTA_ARTICULOS.List(LISTA_ARTICULOS.ListCount - 1, 1) = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
LISTA_ARTICULOS.List(LISTA_ARTICULOS.ListCount - 1, 2) = ActiveCell.Value
End If
ActiveCell.Offset(1, 0).Select
Wend
Sheets(DON).Select
Range("A1").Select
Application.ScreenUpdating = True
End Sub
If M > 0 Then
LISTA_ARTICULOS.AddItem
ActiveCell.Offset(0, -1).Select 'Colocar el numero de columna en negativo donde esta el valor que
se desea para este cuadro de texto
ActiveCell.Offset(0, 1).Select
LISTA_ARTICULOS.List(LISTA_ARTICULOS.ListCount - 1, 1) = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
LISTA_ARTICULOS.List(LISTA_ARTICULOS.ListCount - 1, 2) = ActiveCell.Value
ActiveCell.Offset(0, -1).Select 'Colocar la diferencia en negativo del numero de columna que hay
menos el numero de columna usada para el cuadro de texto
End If
ActiveCell.Offset(1, 0).Select
Wend
Sheets(DON).Select
Range("A1").Select
Application.ScreenUpdating = True
End Sub
Application.ScreenUpdating = False
Range("A1").Select
DON = ActiveCell.Value
If ActiveCell.Value = 0 Then
ActiveCell.Offset(0, -10).Select
LISTA_ARTICULOS.AddItem
LISTA_ARTICULOS.List(LISTA_ARTICULOS.ListCount - 1, 0) = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
LISTA_ARTICULOS.List(LISTA_ARTICULOS.ListCount - 1, 1) = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
LISTA_ARTICULOS.List(LISTA_ARTICULOS.ListCount - 1, 2) = ActiveCell.Value
Else
ActiveCell.Offset(1, -10).Select
End If
Else
ActiveCell.Offset(0, -10).Select
LISTA_ARTICULOS.AddItem
LISTA_ARTICULOS.List(LISTA_ARTICULOS.ListCount - 1, 0) = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
LISTA_ARTICULOS.List(LISTA_ARTICULOS.ListCount - 1, 1) = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
LISTA_ARTICULOS.List(LISTA_ARTICULOS.ListCount - 1, 2) = ActiveCell.Value
End If
Wend
Sheets(DON).Select
Range("A1").Select
Application.ScreenUpdating = True
End Sub
TEXTO= PRONOMBRE
LISTBOX= LISTA
FOMULARIOGUIA
Sub buscarproductos_1()
FOMULARIOFA.Show
End Sub
Application.ScreenUpdating = False
Sheets("Productos").Select
Range("C9").Select
LISTA.Clear
If M > 0 Then
LISTA.ColumnCount = 7
LISTA.AddItem
ActiveCell.Offset(0, -1).Select
LISTA.List(LISTA.ListCount - 1, 0) = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
LISTA.List(LISTA.ListCount - 1, 1) = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
LISTA.List(LISTA.ListCount - 1, 2) = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
LISTA.List(LISTA.ListCount - 1, 3) = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
LISTA.List(LISTA.ListCount - 1, 4) = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
LISTA.List(LISTA.ListCount - 1, 5) = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
LISTA.List(LISTA.ListCount - 1, 6) = ActiveCell.Value
ActiveCell.Offset(0, -5).Select
End If
ActiveCell.Offset(1, 0).Select
Wend
Sheets("Facturacion").Select
Range("A1").Select
Application.ScreenUpdating = True
End Sub
Private Sub UserForm_Activate()
Application.ScreenUpdating = False
Sheets("Productos").Select
Range("B9").Select
ActiveCell.Offset(0, 50).Select
If ActiveCell.Value = 0 Then
ActiveCell.Offset(0, -50).Select
LISTA.ColumnCount = 7
LISTA.AddItem
LISTA.List(LISTA.ListCount - 1, 0) = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
LISTA.List(LISTA.ListCount - 1, 1) = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
LISTA.List(LISTA.ListCount - 1, 2) = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
LISTA.List(LISTA.ListCount - 1, 3) = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
LISTA.List(LISTA.ListCount - 1, 4) = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
LISTA.List(LISTA.ListCount - 1, 5) = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
LISTA.List(LISTA.ListCount - 1, 6) = ActiveCell.Value
ActiveCell.Offset(1, -6).Select
Else
ActiveCell.Offset(1, -50).Select
End If
Wend
Sheets("Facturacion").Select
Range("A1").Select
Application.ScreenUpdating = True
End Sub
Application.ScreenUpdating = False
L = LISTA.List(LISTA.ListIndex, 0)
Sheets("Productos").Select
Range("B9").Select
While ActiveCell.Value <> "" And ActiveCell.Value <> L And ActiveCell.Value <> Val(L)
ActiveCell.Offset(1, 0).Select
Wend
Unload Me
FORMULARIO.Show
Else
mensaje = LISTA.List(LISTA.ListIndex, 6)
If mensaje > 0 Then
COD1 = ActiveCell.Value
ActiveCell.Offset(0, 0).Select
NOMB1 = ActiveCell.Value
Sheets("Facturacion").Select
Rows("10:10").Select
Rows("10:10").Font.ColorIndex = RGB(0, 0, 0)
Range("E10").Select
Range("F10").Select
Range("B10").Select
ActiveCell.Value = NOMB1
Unload Me
Else
MsgBox "No puedes seleccionar un producto con stock : " & mensaje
End If
End If
ERR:
End Sub