Every time I add another If command I have to add an End If at the end. Is there a way to avoid this?Please Login or Register to view this content.
Every time I add another If command I have to add an End If at the end. Is there a way to avoid this?Please Login or Register to view this content.
Thanks in advance.......Steve
ndtsteve,
You can use de "ElseIf" in your code.
Please Login or Register to view this content.
Hi
Try this:
Please Login or Register to view this content.
Click *, if my suggestion helps you. Have a good day!!
Hi Steve,
not sure if the macro really does what you intended. The way how you structured it the second "if" would only be used if the first "if" was already fullfilled. I assume you would like to have it like this instead:
RegardsPlease Login or Register to view this content.
Theo
Remember To Do the Following....
1. Upload sample files
2. Thank those who have helped you by clicking the Star below the post.
3. Please mark your post [SOLVED] if it has been answered satisfactorily.
jraj1106 was quicker :-) credits go to him
I have tried using ElseIf but if I do that then the subroutine stops after the first MsgBox and does not go thu the rest of them. It runs thru them all if I just use the If's and EndIf's. I am just wondering if there is a 'neater' way to wtite the code.
Please Login or Register to view this content.
Steve,
you could do it like this, but it would mean your would activate a new sheet even though the actual issue is not solved.
RegardsPlease Login or Register to view this content.
theo
Thanks Fettertiger (theo) that it a great help and now it steps thru the routine
ndtsteve,
Fettertiger is right, your macro should show the error to the user. You can use TextBox instead of MsgBox to user insert the value.
Pulsus
Which structure you use depends on the logic needs of your program.
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks