Keep getting Else Without If errors... someone help me with the proper syntax for my code:
![]()
Please Login or Register to view this content.
Please and thank you!!
Keep getting Else Without If errors... someone help me with the proper syntax for my code:
![]()
Please Login or Register to view this content.
Please and thank you!!
Last edited by HeyInKy; 10-15-2014 at 04:00 PM.
I am not sure why you have and after then, but this will get rid of the error, though it might not be correct
![]()
Please Login or Register to view this content.
When you put the a statement after the Then on the same line,the whole line stands alone as a single statement. It is not part of an If/End If structure. To fix that, move the statement after the Then onto the next line.
Because you are checking chk to be either True or False your logic can be further simplified to
![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
Regards, TMS
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
Upon reading AB33's post I realized that you almost certainly have another error.
This is syntactically legal but I am 99.9% sure it's not what you intend.![]()
Please Login or Register to view this content.
I suspect you really want to do two separate things:
The And is logical operator. It does not mean "do this And do that".![]()
Please Login or Register to view this content.
Yes - thanks to all - I realized I do not need the AND operator...
and actually, playing with the provided suggestions, I have two sub routines that appear (at first testing) to accomplish what I need without using ELSE and/or END if...
and![]()
Please Login or Register to view this content.
Thanks again!![]()
Please Login or Register to view this content.
You're welcome.![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks