2012-10-07 130 views

回答

4

使用Application.Intersect,像這樣(在VBA)

Sub TestIntersect() 
    Dim MyRange As Range 
    Dim TestRange As Range 

    Set TestRange = [$A$1:$Z$10] 
    Set MyRange = [P5] 

    If Not Application.Intersect(MyRange, TestRange) Is Nothing Then 
     Debug.Print "the ranges intersect" 
    End If 

End Sub 
相關問題