I'm having troubles finding a value ("Not Assigned") in two non-adjacent ranges. Both ranges are populated from these codes,,,
If the value "Not Assigned" is anywhere in those 2 ranges, then it will return a msgbox I made called MsgBoxNoMatch, if not then MsgBoxYesMatch.
The latest code I tried is below, but it is one attempt of many,,,
No matter what is in either range I get MsgBoxNoMatch, even when I tried a loop it still won't work. Any suggestions.
Code:
.Range("AD5:AD100").Value = "=IF(ISBLANK(RC[-1]),"""",IF(ISERROR(MATCH(RC[-1],R5C27:R" & LDR_EH_4_04 & "C27,0)),""Not Assigned"",""Used"" ))" 'STATUS
.Range("AI5:AI100").Value = "=IF(ISBLANK(RC[-1]),"""",IF(ISERROR(MATCH(RC[-1],R5C27:R" & LDR_EH_4_04 & "C27,0)),""Not Assigned"",""Used"" ))" ' status
The latest code I tried is below, but it is one attempt of many,,,
Code:
Dim AddOnRange As Range
Set AddOnRange = AA04.Range("AD5:AD100")
Dim WorksheetRange As Range
Set WorksheetRange = AA04.Range("AI5:AI100")
Dim MyRange As Range
Set MyRange = Union(AddOnRange, WorksheetRange)
Dim str As String
str = "Not Assigned"
Dim srchRng As Range
Set srchRng = MyRange.Find(what:=str)
If srchRng Is Nothing Then '''''Not Assigned' not present
Load MsgBoxNoMatch
MsgBoxNoMatch.Show
Else
Load MsgBoxYesMatch
MsgBoxYesMatch.Show
End If
No matter what is in either range I get MsgBoxNoMatch, even when I tried a loop it still won't work. Any suggestions.