i'm school principal , i'm trying make scheduling managment app in excel.
i have 1 sheet each class , 1 sheet each teacher.
all sheets same , have important information on same coordinates.
for now, i've been able make classes timetables copy on teacher's , works charm. make students timetables , automatically makes teacher's.
now have bit of problem.
if assign teacher to, let's monday @ 8.30 1 class , then, mistake assign same teacher class overlaps , carries on first class teacher. last week same teacher assign 2 classes @ same time.
so question this:
is there way make (on cell change) vba script checks if cell b29 has same value on other sheets, regardless of sheet's possition , name?
ex:
i assign teacher class 1 - monday 8.30 teacher name , date/hour cell b29, class cell d5 , sheet name.
if assign, in class, same teacher b29 if display msgbox saying "there overlap".
what have trouble every year classes , teachers change , relative position of sheets change due year of course , number of courses/classes,
thanks!
i think code this: copy code sheet(code):
private sub worksheet_change(byval target range) if not intersect(target, range("b29")) nothing if selection.cells.count = 1 result = gettime(range("b29").value) end if end if end sub
copy code module1
function gettime(timeadd date) each ws in worksheets if ws.name <> activesheet.name if ws.range("b29").value = timeadd result = true exit end if end if next if result = true msgbox "there overlap." end function
hope help
Comments
Post a Comment