Thank you SamT, p45cal, snb and everyone else that has taken time to look at this and assist me. I have been a little apprehensive to upload a sample workbook because in order to do that I would have to go through it to remove a massive amount of sensitive information yet still make it so this portion of the workbook would still function, and I knew that would take a while to do. I have done that now and I think the best thing is to maybe have someone look at it so you can see exactly what I am trying to accomplish. I am hoping it will make much more sense.
I had most of these selected but selected all of the options you have here.
I am very familiar with breakpoints and stepping through code, I use that all the time but setting another breakpoint and using the F5 is new to me to go through loops.
Watching the value of variables with tooltips is also new to me.
There are multiple people that use their own version of this workbook that I developed and maintain for my company to schedule appointments at schools in their region, some of the people using it are not very knowledgeable about all things Excel. The purpose of this is to make it much easier to set multiple future appointments (usually scheduled once or twice once a month for a year in advance) at a user defined weekly interval with one entry on the UserForm instead of having to set each future appointment one at a time. Maybe I have some good ideas but they also may be overly difficult or too unrealistic, someone that knows better than I can let me know, however, I have done some pretty crazy things with VBA over the years even with my limited understanding of VBA (comparatively speaking). You will see several fields on the UserForm...
- SchoolNameComboBox - This is where the school will be selected
- -
- ApptDateTextBox - This is where the future-most date will be returned once a school is selected (which currently works). This date should change if there is a number entered in WeeklyIntervalTextBox (see below)
- -
- ApptTimeTextBox - The user will enter a time for all of the appointments to be scheduled once the Enter button is pressed.
- -
- SchedStatusComboBox - The user will set a status for all of the appointments to be set here i.e. "Scheduled", "** Job Fair **, "** Meeting ** etc. This will be entered on all of the new appointments that are on the UserForm will set once the Enter button is pressed
- -
- DefaultNoteTextBox - The user will set a note for the appointments to be set here if they want to (optional field). This will be entered on all of the new appointments that are on the UserForm will set once the Enter button is pressed
- -
- NumberOfApptsTextBox - If there is a number entered here, AND there is a number entered in WeeklyIntervalTextBox then it will set that number of future appointments each at the interval set in WeeklyIntervalTextBox. If there is a number in NumberOfAppointmentsTextBox but no number in WeeklyIntervalTextBox, it will not set any appointments but maybe put up a Message Box saying they need to set an interval
- -
- WeeklyIntervalTextBox - If there is a number here, it will 1. advance the date that was already returned in ApptDateTextBox by that number of weeks so that is shows what the date of the NEXT appointment that is going to be set will be. 2. If there is a number in NumberOfApptsTextBox OR a date set in StopDateTextBox (see below) then it will create future appointments until one of the entry's is met.
- -
- StopDateTextBox - If there is a date set here, it will over-ride NumberOfAppointmentsTextBox and do a hard stop in setting appointments once the next appointment would exceed this date but will set all appointments until it reaches this date. In other words if the user enters 12 in NumberOfApptsTextBox and there is WeeklyIntervalTextBox of 6 (weeks) but there is a date of 3/30/2020 in StopDateTextBox it will set all appointments but will stop once the appointments would exceed 3/30/2020 because there are not 12 - 6 week intervals between today and 3/30/2020.
Thank you everyone for all your help, it is GREATLY appreciated...