Professional Documents
Culture Documents
Codigo para Generar Los Bonos de Los Empleados en TREBOL
Codigo para Generar Los Bonos de Los Empleados en TREBOL
Range("a2").Activate
'Cuenta = Me.LstHisNom.ListCount
Set rango = Range("A1").CurrentRegion
Set a = Sheets("Bonos2022")
a.Cells.Clear
filaedit = 1
For x = 0 To Me.LstBonEmp.ListCount - 1
a.Cells(filaedit, "A") = Me.LstBonEmp.List(x, 0)
a.Cells(filaedit, "B") = Me.LstBonEmp.List(x, 1)
a.Cells(filaedit, "C") = Me.LstBonEmp.List(x, 2)
a.Cells(filaedit, "D") = Me.LstBonEmp.List(x, 3)
a.Cells(filaedit, "D") = Me.LstBonEmp.List(x, 4)
a.Cells(filaedit, "E") = Me.LstBonEmp.List(x, 5)
a.Cells(filaedit, "f") = Me.LstBonEmp.List(x, 6)
a.Cells(filaedit, "G") = Me.LstBonEmp.List(x, 7)
a.Cells(filaedit, "H") = Me.LstBonEmp.List(x, 8)
a.Cells(filaedit, "I") = Me.LstBonEmp.List(x, 9)
a.Cells(filaedit, "J") = Me.LstBonEmp.List(x, 10)
a.Cells(filaedit, "K") = Me.LstBonEmp.List(x, 11)
a.Cells(filaedit, "L") = Me.LstBonEmp.List(x, 12)
a.Cells(filaedit, "M") = Me.LstBonEmp.List(x, 13)
a.Cells(filaedit, "N") = Me.LstBonEmp.List(x, 14)
a.Cells(filaedit, "O") = Me.LstBonEmp.List(x, 15)
a.Cells(filaedit, "P") = Me.LstBonEmp.List(x, 16)
'a.Cells(filaedit, �Q�) = Me.LstBonEmp.List(x, 17)
filaedit = filaedit + 1
Next x
'For i = 0 To Cuenta - 1
' If Me.LstHisNom.Selected(i) Then
' valor = Me.LstHisNom.List(i, 1)
' rango.Find(What:=valor, LookAt:=xlWhole, After:=ActiveCell).Activate
'Cargar el listBox Bonificaci�n
' x = Val(Me.LstHisNom.List(i, 0))
' CargarEmpleado Cells(x, 1), Cells(x, 3)
'
' End If
'Next i
End Sub
With Me.LstMasEmp
.ColumnCount = 34
End With
EncabezdoBonEmp
EncabezdoHisNom
With Me
' Limpiar el TextBox, combobox y agregar las columnas de busqueda
' .TxtValor.Value = ""
' .CbxCampos.Clear
.LstMasEmp.Visible = True
.LstBonEmp.Visible = True
.LstMasEmp.ColumnWidths = "80 pt;80 pt;80 pt;80 pt"
.LstBonEmp.ColumnWidths = "90 pt;90 pt;90 pt;90 pt"
.LstHisNom.ColumnWidths = "80 pt;80 pt;80 pt;80 pt"
'.CbxCampos.List =
Application.Transpose(ActiveCell.CurrentRegion.Resize(1).Value)
'.CbxCampos.ListStyle = fmListStyleOption
End With
End Sub
i = Me.LstBonEmp.ListCount
Me.LstBonEmp.AddItem
Me.LstBonEmp.List(i, 0) = "Linea"
Me.LstBonEmp.List(i, 1) = "EmpID"
Me.LstBonEmp.List(i, 2) = "Empleado"
Me.LstBonEmp.List(i, 3) = "C�dula"
Me.LstBonEmp.List(i, 4) = "Depto."
Me.LstBonEmp.List(i, 5) = "Fec. Ingreso"
Me.LstBonEmp.List(i, 6) = "Fec. Salida"
Me.LstBonEmp.List(i, 7) = "Ene"
Me.LstBonEmp.List(i, 8) = "Feb"
Me.LstBonEmp.List(i, 9) = "Mar"
Me.LstBonEmp.List(i, 10) = "Abr"
Me.LstBonEmp.List(i, 11) = "May"
Me.LstBonEmp.List(i, 12) = "Jun"
Me.LstBonEmp.List(i, 13) = "Jul"
Me.LstBonEmp.List(i, 14) = "Ago"
Me.LstBonEmp.List(i, 15) = "Sep"
Me.LstBonEmp.List(i, 16) = "Total Acumulado"
End Sub
With Me.LstHisNom
.ColumnCount = 22
.List = Range(Cells(1, 1), Cells(1, .ColumnCount)).Value
.RemoveItem 0
End With
Me.LstHisNom.RowSource = "TbNomina"
On Error GoTo 0
End Sub
ActEmpID = Val(EmpID)
ActMes = Val(Mes)
EncabezdoBonEmp
If Val(Me.LstHisNom.List(x, 0)) = 5880 Then MsgBox "el Movimieno es: " &
Me.LstHisNom.List(x, 13) & " Por: " & Me.LstHisNom.List(x, 7)
If Val(Me.LstHisNom.List(x, 0)) = 5880 Then MsgBox "el Movimieno es: " &
Me.LstHisNom.List(x, 13) & " Por: " & Me.LstHisNom.List(x, 7)
Else
'Mover el empleado procesado (ActEmpID) y sus Totales por mes y el Total
acumulado
'Agrega las generales del empleado al List de Bonificaci�n
' If TotalAcu > 0 Then
Me.LstBonEmp.AddItem
Me.LstBonEmp.List(i, 0) = Str(i)
Me.LstBonEmp.List(i, 1) = ActEmpID
Me.LstBonEmp.List(i, 2) = BuscarEmpNom(ActEmpID)
Me.LstBonEmp.List(i, 3) = BuscarEmpCed(ActEmpID)
Me.LstBonEmp.List(i, 4) = BuscarEmpDep(ActEmpID) 'Me.LstHisNom.List(i, 17)
Me.LstBonEmp.List(i, 5) = Format(BuscarEmpFin(ActEmpID), "dd/mm/yyyy") 'Buscar
Fecha de Ingreso
Me.LstBonEmp.List(i, 6) = Format(BuscarEmpFsa(ActEmpID), "dd/mm/yyyy") 'Buscar
Fecha de Salida
Me.LstBonEmp.List(i, 7) = Format(TotalEne, "#,##0.00")
Me.LstBonEmp.List(i, 8) = Format(TotalFeb, "#,##0.00")
'Inicializa las variables para los totales por empleado en los meses y el
acumulado
TotalEne = 0
TotalFeb = 0
TotalMar = 0
TotalAbr = 0
TotalMay = 0
TotalJun = 0
TotalJul = 0
TotalAgo = 0
TotalSep = 0
TotalAcu = 0
End If 'valido empleado
Next x
'Agrega los Totales
'LblTotIng.Caption = Format(TotalIngresos, "#,##0.00")
'LblTotDsc.Caption = Format(TotalDescuentos, "#,##0.00")
'LblNetPag.Caption = Format((TotalIngresos - TotalDescuentos), "#,##0.00")
End Sub
End If
Next x
End Function
End If
Next x
End Function