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