Dim pr As Row = Nothing For Each r As Row In Tables("表A").rows If r.IsNull("第一列") Then r("第一列") = pr("第一列") & "." & format(r.Index - pr.Index, "00") r("第二列") = pr("第二列") & "-" & r("第三列") Else pr = r End If Next
Dim pr As Row = Nothing For Each r As Row In Tables("表A").rows If r.IsNull("第一列") AndAlso r.IsNull("第三列") = False Then r("第一列") = pr("第一列") & "." & format(r.Index - pr.Index, "00") r("第二列") = pr("第二列") & "-" & r("第三列") Else pr = r End If Next