I'm trying to adjust this macro stop that the macro stops if the user hits cancel.
Please Login or Register to view this content.
I'm trying to adjust this macro stop that the macro stops if the user hits cancel.
Please Login or Register to view this content.
I must be missing something. If I click Cancel the InputBox disappears and there is no change in J63.
What are you seeing?
Hi,
Try this:What you have will work, however if you have some more code after the If...Then statement then the Exit Sub is required as above to stop it from executingPlease Login or Register to view this content.
Well, you haven't really got anything to stop it from but
Please Login or Register to view this content.
This will stop if the presses Enter with an empty box, selects Cancel or presses Escape. Otherwise it will put the value in the cell and display the message.
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
I'm attaching a sample, it's kind of hard to explain. When the user clicks on the dropdown in the ribbon and clicks cancel, I don't wan't the image or any other data to show.
There are only 4 drop-downs in your Ribbon, and none of them have a Cancel option...can you please elaborate for us?
It's setup to only be accessed by the windows user name in the cuiZ_DataSource Module
Please Login or Register to view this content.
Last edited by guitarsweety; 07-28-2014 at 07:03 PM.
But why do you want a Cancel button? If the user clicks on one of the drop-downs and wants to Cancel, then all they have to do is click off the list somewhere...
Nonetheless, I have changed the Month_onAction subroutine to do what I think you are trying to achieve if the user selects "NA" from the drop-down (NB: I have only changed the Human Resource drop-down, not the other 3).
Let me know if this helps
Oh my goodness ajryan88, this works exactly like I want it too and I can definitely adjust the others, thank you so much for your help with this. I'm jumping up and down and can get back to my crochet
No worries. The only thing I should mention (just in case you missed the subtlety), is that this won't work if more names are added to the list, as the index refers to the position of the selected item on the list. So just make sure you change the value of index in the If...Then condition if you add to the list.
Also, please don't forget to mark this thread as solved (Thread Tools --> Mark As Solved), and please click on the * next to my post to say thanks
Thank you for bringing that to my attention. I'll look more into the index. Thank you again. I love learning something new.
Oh wait one more thing I just saw thisIf I have say 3 do I just change to sayPlease Login or Register to view this content.
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks