check range is in another range vba
If Application.Intersect(rng1, rng2) Is Nothing Then
'herecomesthecode
Else
'herecomesthecode
End if
check range is in another range vba
If Application.Intersect(rng1, rng2) Is Nothing Then
'herecomesthecode
Else
'herecomesthecode
End if
excel vba range contains
' Tests if a range contains a value
Sub TestMe()
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets(1)
If Application.WorksheetFunction.CountIf(ws.Range("A2:A10"), _
ws.Range("A1")) = 0 Then
Debug.Print "No match"
Else
Debug.Print "Range contains value " & ws.Range("A1").Cells(1, 1).Value
End If
End Sub
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us