Reputation: 191
Goodmorning from Holland,
I'm just n00bing around VBA, and keep bumping in to said compilation error as seen in this screenshot;
I would like to see this solved, but i want to learn how to kill these horrible errors. What is my mistake?
Upvotes: 0
Views: 279
Reputation: 940
As the error message is telling you, you are missing one End If
-Statement: You are opening three If
-Cases, but close only two of them. (I guess you want to put the missing one before the line saying If not Rng Is Nothing Then
, thus closing the statement If Trim(FindString) <> "" Then
)
For the future: Proper indentation of your code will help you spot errors like this easily!
Upvotes: 2
Reputation: 377
Your "If Not Rng Is Nothing Then" is missing an "End If"
It should be more obvious if you indent correctly your code.
Upvotes: 2