'自定义公式-按ALT+11-插入-模块(2行查询合并)
Function hebing(a As Range, b As Range, Optional ByVal numformat As String = ",")
Calculate '重算表格
Dim t As String
For i = 1 To a.Columns.Count
If b.Cells(1, i) <> "" Then t = t & numformat & a.Cells(1, i) & "*" & b.Cells(1, i)
If a.Cells(1, i) = "" Then Exit For
Next
hebing = Right(t, Len(t) - 1)
Calculate
End Function