Comando Para Crear Lista Con Buscador

Private sub CLINOMBRE_Change() Application.ScreenUpdating=False Sheets(“CLIENTES”).Select Range(“C5”).Select LISTACLI.Cl

Views 45 Downloads 83 File size 189KB

Report DMCA / Copyright

DOWNLOAD FILE

Recommend stories

Citation preview

Private sub CLINOMBRE_Change() Application.ScreenUpdating=False Sheets(“CLIENTES”).Select Range(“C5”).Select LISTACLI.Clear While ActiveCell.Value”” M=InStr(1, UCase(ActiveCell.Value), UCase(CLINOMBRE.Text)) If M>0 Then LISTACLI.ColumnCount=6 LISTACLI.Additem ActiveCell.Offset(0,-1).Select LISTACLI.List(LISTACLI.ListCount-1,0)=ActiveCell.Value ActiveCell.Offset(0,1).Select LISTACLI.List(LISTACLI.ListCount-1,1)=ActiveCell.Value ActiveCell.Offset(0,1).Select LISTACLI.List(LISTACLI.ListCount-1,2)=ActiveCell.Value ActiveCell.Offset(0,1).Select LISTACLI.List(LISTACLI.ListCount-1,3)=ActiveCell.Value ActiveCell.Offset(0,1).Select LISTACLI.List(LISTACLI.ListCount-1,4)=ActiveCell.Value ActiveCell.Offset(0,1).Select LISTACLI.List(LISTACLI.ListCount-1,5)=ActiveCell.Value ActiveCell.Offset(0,-4).Select End If ActiveCell.Offset(1,0).Select Wend Sheets(“FACTURA”).Select Range(“A1”).Select Application.ScreenUpdating=True End Sub Private Sub CLIIDENTIDAD_Change() Application.ScreenUpdating=False Sheets(“CLIENTES”).Select Range(“G5”).Select LISTACLI.Clear While ActiveCell.Value”” M=InStr(1, UCase(ActiveCell.Value), UCase(CLIIDENTIDAD.Text)) If M>0 Then

LISTACLI.ColumnCount=6 LISTACLI.Additem ActiveCell.Offset(0,-5).Select LISTACLI.List(LISTACLI.ListCount-1,0)=ActiveCell.Value ActiveCell.Offset(0,1).Select LISTACLI.List(LISTACLI.ListCount-1,1)=ActiveCell.Value ActiveCell.Offset(0,1).Select LISTACLI.List(LISTACLI.ListCount-1,2)=ActiveCell.Value ActiveCell.Offset(0,1).Select LISTACLI.List(LISTACLI.ListCount-1,3)=ActiveCell.Value ActiveCell.Offset(0,1).Select LISTACLI.List(LISTACLI.ListCount-1,4)=ActiveCell.Value ActiveCell.Offset(0,1).Select LISTACLI.List(LISTACLI.ListCount-1,5)=ActiveCell.Value ActiveCell.Offset(0,-0).Select End If ActiveCell.Offset(1,0).Select Wend Sheets(“FACTURA”).Select Range(“A1”).Select Application.ScreenUpdating=True End Sub Private Sub UserForm_Activate() Application.ScreenUpdating=False Sheets(“CLIENTES”).Select Range(“B5”).Select While ActiveCell.Value”” ActiveCell.Offset(0,50).Select If ActiveCell.Value=0 Then ActiveCell.Offset(0,-50).Select LISTACLI.ColumnCount=6 LISTACLI.Addltem LISTACLI.List(LISTACLI.ListCount-1,0)=ActiveCell.Value ActiveCell.Offset(0,1).Select LISTACLI.List(LISTACLI.ListCount-1,1)=ActiveCell.Value ActiveCell.Offset(0,1).Select LISTACLI.List(LISTACLI.ListCount-1,2)=ActiveCell.Value ActiveCell.Offset(0,1).Select

LISTACLI.List(LISTACLI.ListCount-1,3)=ActiveCell.Value ActiveCell.Offset(0,1).Select LISTACLI.List(LISTACLI.ListCount-1,4)=ActiveCell.Value ActiveCell.Offset(0,1).Select LISTACLI.List(LISTACLI.ListCount-1,5)=ActiveCell.Value ActiveCell.Offset(1,-5).Select Else ActiveCell.Offset(1,-50).Select End If Wend Sheets(“FACTURA”).Select Range(“A1”).Select Application.ScreenUpdating=True End Sub Private Sub LISTACLI_DblClick(ByVal Cancel As MSForms.ReturnBoolean) Application.ScreenUpdating=False On Error GoTo ERR: L=LISTACLI.List(LISTACLI.Listindex,0) Sheets(“CLIENTES”).Select Range(“B5”).Select While ActivateCell.Value”” And ActivateCell.ValueL And ActivateCell.ValueVal(L) ActiveCell.Offset(1,0).Select Wend If ActivateCell.Value=””Then Unload Me FORMULARIOCLI.Show Else COD1=ActivateCell.Value ActiveCell.Offset(0,0).Select NOMB1=ActivateCell.Value Sheets(“FACTURA”).Select Range(“C7”).Select ActiveCell.Value=NOMB1 Unload Me End If ERR: End Sub