Excel跨表求和
Function sumallofvalue(cellName, num)
Dim temp As Double
For i = 2 To ThisWorkbook.Sheets.Count Step 1
temp = 0
On Error Resume Next
temp = ThisWorkbook.Sheets.Application.WorksheetFunction.VLookup(cellName, ThisWorkbook.Sheets(i).Range("B:G"), num, 0)
On Error GoTo 0
sumallofvalue = sumallofvalue + temp
Next i
End Function