The simpler the code the easier to detect errors
I'd also prefer simpler names of Userformcontrols:Private Sub SchoolNameComboBox_Change() sn = Sheets("Future Appointments").Cells(1).CurrentRegion For j = 2 To UBound(sn) If sn(j, 1) = Schoolnamecombobox Then If sn(j, 6) > y Then y = sn(j, 6) Next ApptDateTextBox = IIf(IsEmpty(y), "", DateAdd("ww", Val(WeeklyIntervalTextBox), y)) End Sub
Avoid any unnecessary feature like 'protection'.Private Sub C_00_Change() sn = Sheets("Future Appointments").Cells(1).CurrentRegion For j = 2 To UBound(sn) If sn(j, 1) = C_00 Then If sn(j, 6) > y Then y = sn(j, 6) Next T_00 = IIf(IsEmpty(y), "", DateAdd("ww", Val(T_01), y)) End Sub
NB. Also a completely 'self taught' autodidact


Reply With Quote


