我正在其计算每名员工每周检视小时的时间片之前相同。我已经实施了一些代码,用于确定员工是否属于公司,无薪休假,离开公司或已经离职。如何检查是否单元格的行前是增加了反
我想要做的就是创建一个表,告诉我加入者,毕业生和按周的无薪休假的数量。
应用代码到我的数据进行排序后,它看起来是这样的:
我想创建一个表,增加了木匠柜台首次行的值未加入”所以我不重复计数英寸例如,ID 1,我不想指望那个人在周2木匠 - 5,只有在周2
这是到目前为止我的代码,我在移动之前在看每列行下一列:
Dim LastCol As Long
Dim LastRow As Long
Dim I As Long
Dim Z As Long
Dim Q As Long
Dim Joined As Integer
Dim ws As Worksheet
'set worksheet to use
Set ws = Sheets("Sheet1")
With ws
'Find last col and row for range
LastCol = ws.Cells(3, Columns.Count).End(xlToLeft).Column
LastRow = ws.Cells(Rows.Count, D).End(xlUp).Row
For I = 3 To LastCol
NotJoined = 0
For Z = 4 To LastRow
'check if cell is > 0
If ws.Cells(Z, I).Value > 0 Then
Joined = Joined + 1
End If
Next Z
'Find last row and add value to row below
Q = ws.Cells(Rows.Count, I).End(xlUp).Row
ws.Cells(Q + 1, I).Value = Joined
Next I
End With
我将如何添加一个方法来只能算一个木匠(打算从没有加入任何其他值)/离校生一次(从任意值X会)的任何给定行中却发现这些价值每周。我正在朝着具有类似于下面的表:
提前感谢!