Working With An Error From Invalid Entry Into Userform Combobox

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,564
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I know this question could be avoided with proper planning and coding appropriately. I figure with my novice abilities in VBA that I would need to do some serious rewriting to do it right, and right now time is of an essence. I suspect this is going to be difficult to explain.

Suppose I have this quasi code ..

Code:
sub process1
      call firstproc
      call secondproc
      call thirdproc
end sub

Essentially , is it possible to interrupt this procedure and then resume it?

For example, firstproc will populate a database with activities and times for each.
Thirdproc anaylses the data created in firstproc, and utilizing a staff schedule, will assign various staff to different tasks associated with that activity. To do this, the previously defaulted staff schedule must be accurate.
So, I have included secondproc which instructs the user to go back to the worksheet with the staff schedule and review it's accuracy. From the worksheet with the staff schedule, there is a button "OK" which, after review the user is satisfied with it's accuracy, will lock the staff schedule. I then would like to resume then, and only then, with thirdproc. The user can also edit the staff schedule, and once editted, pressing OK will lock the changes, and advance the code to thirdproc.

I don't know how to interrupt procedure process1 to allow the user to review/edit/ok the schedule before proceeding.

secondproc is just a message to the user, but clearly exiting the message will resume procedure process1 before the user has a chance to review the staff schedule.

Can anyone suggest an option for this situation?
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
You should move proc3 call to proc2 commandbutton click?
 
Upvote 0
That's an idea Micron, but there is yet so much more code in process1 that follows thirdproc. I would have to include all that as well?

PS ... My apologies the title I realize has nothing to do with the question. It was remnents of a saved message that wasn't sent. (and I forgot to edit the title when I rewrot the contents).
 
Upvote 0
process1 is a new term now, which means nothing to me so I don't really understand the question. I have no idea what any of these #proc procedures do and can only address the logical flow of things that must happen in stages. If I did all the data crunching in stage one I'd simply present it for review. If the 2nd stage is to approve the data, then that stage should make the call to stage3 or whatever should happen next. If that 3rd stage completes the task, then that's it. If it doesn't, then the 3rd stage initiates the 4th and so on?

To be clear, I'm not saying move proc3 code to proc2 if that's what you got from my post, I'm saying move the call into proc2.
 
Upvote 0

Forum statistics

Threads
1,215,063
Messages
6,122,935
Members
449,094
Latest member
teemeren

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top