When I try to run the following VBA code, I get a Block If without End If error. I can't figure out where I need to add the End If or if more than one is needed.
Please Login or Register to view this content.
When I try to run the following VBA code, I get a Block If without End If error. I can't figure out where I need to add the End If or if more than one is needed.
Please Login or Register to view this content.
Last edited by dannykeith; 10-12-2010 at 10:32 AM. Reason: Add code tags
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
Where there is a will there are many ways.
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
If you indent your code, you'll see you have many unclosed block Ifs:
The indenting should come all the way back to the left.Please Login or Register to view this content.
Last edited by shg; 10-12-2010 at 10:35 AM. Reason: waiting for OP
Entia non sunt multiplicanda sine necessitate
When I used the code I got the same error message.
Your code is unchanged other than indenting it just to make the problem visually apparent, Danny. I can't make a suggestion because I don't know the logic you're trying to implement -- but you can see that your code is getting more deply nested without unwinding.
You might benefit by changing your approach, just switch from deeply nested IF structure to a simpler Select case Structure
like so.
Another way to help clear up your code is to factor out the repeating stuff. Your code constantly repeats range locations. You could try adding something like this to you code. It will make it much easier to read too.Please Login or Register to view this content.
Please Login or Register to view this content.
Gordon in Rovereto, Italy
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks