End If without block if

LuisV805

New Member
Joined
Jan 9, 2014
Messages
23
Hi all,

I'm trying to rub my sub, however, I'm getting a "End if without block if" error and directs me to the below. The if is tens of lines long so I don't want to post the whole thing. This is basically what it looks like:

If InStr(1, ActiveCell.Value, "(", vbTextCompare) Then
<Block of Code>
End If

My first instinct is that I didn't close something in the block of code breaking the connection between the "IF" and "END IF", but I'm new so I want to make sure there's nothing wrong with the first line here (first time using InStr) in an if statement. Can someone confirm the first line was written correctly?
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
LuisV805,

What version of Excel and Windows are you using?

I was able to step thru the two lines of code without a problem.

We need to see your entire macro.


When posting VBA code, please use Code Tags - like this:

[code]

Paste your code here.

[/code]
 
Upvote 0
LuisV805,

Thanks for the feedback.

You are very welcome. Glad you were able to fix the problem.

And, come back anytime.
 
Upvote 0

Forum statistics

Threads
1,202,965
Messages
6,052,836
Members
444,603
Latest member
dustinjmangum

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top