我有一个出勤电子表格,我需要汇总一行并在最后一列中包含总数 . 每行代表一名员工,每列代表一个月中的某一天 . 我使用VBA的原因是因为某些日期列将包含文本,例如TA for Tardy,如果TA存在于该范围中的一个或多个单元格中,则需要将总数加0.5 .
我只能填充第一行,而不是它下面的行 . 我猜这是因为我没有正确设置范围 . 这是我到目前为止的代码:
Dim wsJAN As Worksheet 'Used to reference the sheet by its TAB name in the WB
Dim LastRow As Long 'Last used row on sheet
Dim tDays As Range 'Total # of days the employee has actually worked
Dim cDays As Range 'Current # of days the employee should have worked
Dim rowEmployee As Range 'Used to define the columns to be used to when adding attendance for each employee row
Dim rCell As Range
LastRow = Cells.Find(What:="*", After:=[A3], SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Application.ScreenUpdating = False
Set wsJAN = ThisWorkbook.Sheets("JAN")
Set tD