Reputation: 1505
I'm trying to get a True or False, depending on, if a string is found in the worksheet "fal".
Dim stress As Boolean
If fal.UsedRange.Find("Approach = STRESS") > 0 Then
stress = True
Else
stress = False
End If
It gives a "Run-time error '91': Object variable or With block not set"
Any ideas?
Upvotes: 1
Views: 5492
Reputation: 35853
Try this:
Dim stress As Boolean
stress = Not fal.UsedRange.Find("Approach = STRESS") Is Nothing
Upvotes: 3