考勤表自动求和,除了SUM函数还有什么方法?

考勤表能自动求和吗

Sub CalculateSum()
Dim lastRow As Long
lastRow = Cells(Rows.Count, “B”).End(xlUp).Row ‘ 假设B列是数据列
Dim sumValue As Double
sumValue = WorksheetFunction.Sum(Range(“B2:B” & lastRow))
MsgBox “总和是: ” & sumValue
End Sub

利唐i人事HR社区,发布者:ihreditor,转转请注明出处:https://www.ihr360.com/hrnews/20241211488.html

(0)
上一篇 1天前
下一篇 1天前

相关推荐