Excel实战技巧19:在状态栏中显示两个或两组单元格数值之差( 六 )

    On Error Resume Next

   

    Set wf = Application.WorksheetFunction

   

    If rSel.Areas.Count = 1 Then

        If rSel.Columns.Count = 2 Then

            vStatus = "

相差

: "& Format(wf.Sum(rSel.Columns(1)) - wf.Sum(rSel.Columns(2)),"#,##0.00")

        ElseIf rSel.Rows.Count = 2 Then

            vStatus = "

相差

: "& Format(wf.Sum(rSel.Rows(1)) - wf.Sum(rSel.Rows(2)), "#,##0.00")

        Else