svendiamond
Well-known Member
- Joined
- Jun 13, 2014
- Messages
- 1,504
- Office Version
- 365
- Platform
- Windows
I am trying to find a string (myLookup) in range "balRangeA"
If I don't find it there, I want to look in "balRangeB"
If I don't find it there, I want to look in "incRangeA"
Is there an easier / shorter way to manage this rather than this code I currently have:
I especially want to know this because I have a lot more ranges that I need to lookup and I don't want to keep writing this IF statement.
If I don't find it there, I want to look in "balRangeB"
If I don't find it there, I want to look in "incRangeA"
Is there an easier / shorter way to manage this rather than this code I currently have:
Code:
Dim foundIt As Range
Set foundIt = balRangeA.Find(myLookup, , , xlWhole)
If foundIt Is Nothing Then
Set foundIt = balRangeB.Find(myLookup, , , xlWhole)
End If
If foundIt Is Nothing Then
Set foundIt = incRangeA.Find(myLookup, , , xlWhole)
End If
I especially want to know this because I have a lot more ranges that I need to lookup and I don't want to keep writing this IF statement.