Why does this keep telling me "block if without end if" when there clearly is an "end if"![]()
Please Login or Register to view this content.
excel 2010 btw
thanks
Why does this keep telling me "block if without end if" when there clearly is an "end if"![]()
Please Login or Register to view this content.
excel 2010 btw
thanks
Last edited by vonblart; 11-16-2010 at 02:10 PM. Reason: title change per request
Please, rename your title according to the rules:
Please read and adhere to these simple rules!
1. Use concise, accurate thread titles. Your post title should describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
To change the title of the thread, click EDIT on the original post, then click the Go Advanced button, then change the title. If two or more hours have passed, the EDIT button will not appear, and you need to ask a moderator to change the title.
Never use Merged Cells in Excel
This is just a guess, I can't work out your logic
![]()
Please Login or Register to view this content.
Always use Option Explicit, and indent your code, it's more than half the battle when debugging.
Hope this helps
If you need any more information, please feel free to ask.
However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....
Also
اس کی مدد کرتا ہے اگر
شکریہ کہنے کے لئے سٹار کلک کریں
If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.
I knew it was simple. I needed to use "elseif" instead of "if" after the first occurrence of "if" and i formatted it in a more proper fashion as suggested. thanks!
So is this your answer?
![]()
Please Login or Register to view this content.
Yes Marcol. Your first post resolved the error, but using elseif gave me the desired output from the macro. I'm new to VBA so tell me if this is this poor coding?
There is nothing wrong with that approach.
I find Select more readable, that's just a personal thing
![]()
Please Login or Register to view this content.
Remember
Always use Option Explicit, and indent your code, it's more than half the battle when debugging.
When naming your variables try to sensibly use upper and lower case in the name, this will make typos easy to detect, but only if you have Option Explicit set.
This will stand you in good stead in the long run.
Try this add-in for indenting it's far better than the standard indent, and used by many of the big boys (and gals) on this forum.
http://www.oaltd.co.uk/Indenter/
Hope this helps
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks