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

Public WithEvents xlApp AsApplication

 

Private Sub xlApp_SheetSelectionChange(ByValSh As Object, ByVal Target As Range)

    If TypeName(Selection) = "Range"Then

        ShowDifferenceStatus Selection

    End If

End Sub

 

在标准模块中,输入下面的代码:

Public gxlApp As

1

 

Public SubShowDifferenceStatus(rSel As Range)

    Dimwf As WorksheetFunction

    Dim vStatus As Variant