Consulting

Results 1 to 20 of 20

Thread: Create school timetable by vba

  1. #1

    Create school timetable by vba

    Is it possible for the vba codes in excel organized lessons in the weekly schedule according to the available data in the worksheet1 (Number of hours for each teacher assigned to teach class) ?
    by dumpng in worksheet2 , taking care to balance the number of lessons in each day
    If possible, I hope to get this code by putting it in the macro button (Dump) in worksheet2 .

    Regards

  2. #2
    Site Admin VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,005
    Location
    yes it's possible but your workbook needs much more explaining, you need to spend a little more time on its structure.
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  3. #3
    can you help me please .?

  4. #4
    Site Admin VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,005
    Location
    Yes but first you must put some effort in yourself, as i said you need to restructure your workbook/data in a fashoin that will be easier to for you to maintain and manipulate data, then when you have done that you need to explain thoroughly what you would like to acheive, how and why!
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  5. #5
    Hi Simon Lloyd
    What do I need Actually in this code is the distribution of teaching hours for teachers in the days of the week, Take for example teacher 1, which assigned a teaching class C4 (t two hours a week) , and class C5 (two hours a week) - and this we know by the numbers in the teachers rows 1 parallel to the class C4 and class C5 ( worksheet1) . so that the figure refers to the number of hours assigned to the teacher to teach the class -.


    • In (worksheet2) there is 5 days in each day there is 7 hours starting from 7:00 to 13:00 pm ,referred to figures 1-7.

    • need to consider the following when dump the table in worksheet2:


    1 - hours must be distributed on the day of the week the balance, if a teacher has 4 hours to teach one class it will be as follows:
    · 1 hour on Monday.
    · 1 hour on Tuesday.
    · 1 hour on Wednesday.
    · 1 hour on Thursday or Friday.


    2 - pasture the number of hours per day for each teacher, if the total hours of teaching for one teacher is 20 hours per week, it will be 4 hours per day.


    3 - one teacher only in the classroom every hour.

    Is this enough to explain ?

    Thanks for your interes



  6. #6
    Site Admin VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,005
    Location
    Your explanation clears up nothing, infact you only confirm the ambiguity of your structure e.g
    · 1 hour on Thursday or Friday.
    Which is it......or don't you care?
    You're expecting excel to take on guess work as to how to split a teachers hours and over which days, by your reckoning if a teacher has a class for 3 hours it can be spread over any day, also if a teacher has a class for 2, 3, 4 , 5....etc hours why is it not possible they have more than one class a day?

    I'm afraid i can't help you with this!
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  7. #7
    VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Peace of mind is found in some of the strangest places.

  8. #8
    Simon Lloyd,
    anyway thank you v.much brother.

    anybody can help me ?

  9. #9
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,098
    Location
    Are the figures presented in your workbook representing those for one week or can it be extended over a greater period of teaching days?

    Example Teacher 1 has 4 hours, You have alluded to 1 hour per day, and with the option of the 4th hour being undertaken either on Thursday or Friday.
    Teacher 2 has 14 hours. If the rule is one hour per day then naturally this means 14 days to complete the teaching, or can there be more than one hour per day?
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  10. #10
    Hi Aussiebear

    No this is not the rule ( that it is one hour for the teacher a day),
    but the rule is:

    Distribute hours on weekdays from Monday - Friday in order to achieve a balance in the schedule .


    According to an example that I reported for teacher1 who has only 4 hours per week,so his teaching hour will be as I explained .


    Teacher2 has 14 hours per week This means that he will teach 3 hours for (4 days) and 2 hour for (one day), so the total of teaching hours (14).

    Teacher19 has 15 hours per week and this means that he will teach 3 hours each day.
    (3 * 5 = 15)

    Teacher29 has 20 hours per week and this means that he will teac 4 hours every day.
    (4 * 5 = 20)


    In this way, the teaching hours of all teachers will be balanced .

  11. #11
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,098
    Location
    A couple more questions based on your workbook

    1. Sheet 1, shows 97 possible teachers over 30 courses in your table. That's 2910 cell values in your range if my maths is correct. What limits are there in this table? Are you limited in the maximum number of hours per course per week?
    2. Sheet 2, shows 100 teacher positions by 35 hour values giving 3500 values in the range.... Are you sure you are going to fill all these?
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  12. #12
    in sheet1 there is :
    30 class
    each class shuled studty 35 hours a week
    so total of teaching hours for all class 1050 hours a week


    ( in sheet 1 ) Some teachers are not assigned to them teaching hours .

    required to greate a schedule for the teachers who assigned to them.
    Last edited by abuzainab73; 07-30-2010 at 11:59 AM.

  13. #13
    Hi Aussiebear

    is this clear ?

  14. #14
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,098
    Location
    Please be patient. I'm just trying to get everything clear so that others can understand the nature of your request
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  15. #15
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,098
    Location
    I can see some real issues with this.
    1. From real life experience - Whilst formal schooling for me finished nearly 30 years ago- I think the process of allocating teacher hours is quite complex. It was more effective for teachers to be teaching in multiple units ( from both an employers perspective and from the teachers perspective), rather than single units. However I digress somewhat.

    2. Allocating teachers on the basis of dividing the total hours by 5 and adding the balance - one unit per day - to each day, may work here but.... this doesn't tell us when in the day to actually allocate the hour. If we were to start at 7am, the school will be flatout in the mornings and potentially be non functioning by afternoon. Is this really an effective method? I would doubt it.

    3. You need to set up some more rules regarding allocation.

    For example: Which subjects are better being taught at which part of the day? Teaching Geology straight after lunch was a recipe for sending classmates into slumberland - from my recollection. Hardly a day went by where one or more of the class ended up having to touch your toes to recieve 6 of the best with the cane.

    Can students move around the school effectively to maximise the education time alloted for a class or do students stay put in the classroom and teachers move around? If teachers move around, do they have time to gather their teaching material and prepare for the next class subject matter?

    Should teachers be given a break between classes to prepare for the forthcoming class/es?

    How many classrooms exist? Maybe it might be better to allocate teachers or students to a class room and then work out how to distribute the lessons?

    I'm afraid that this is a very complex issue regarding the allocation
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  16. #16
    Is there a solution?

  17. #17
    Site Admin VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,005
    Location
    Try and follow Aussibears last post, make the structural changes and answer the questions he posed!
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  18. #18
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,098
    Location
    abuzainab73 why have you posted an image of a child in post #16? This has no relevance to this forum, and it adds nothing constructive to the debate. Please do not do this.
    Last edited by Aussiebear; 08-05-2010 at 11:45 PM. Reason: Edited signature
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  19. #19
    VBAX Expert
    Joined
    Feb 2005
    Location
    Nanaimo, British Columbia, Cananda
    Posts
    568
    Location
    Hi,

    Jumping in again.
    Cheers,

    dr

    "Questions, help and advice for free, small projects by donation. large projects by quote"

    http:\\www.ExcelVBA.joellerabu.com

  20. #20
    VBAX Expert
    Joined
    Feb 2005
    Location
    Nanaimo, British Columbia, Cananda
    Posts
    568
    Location
    Hi,

    No interest in this I guess. I just spent 3 days working on it! Oh well.

    For Sale: 1 custom program.
    Cheers,

    dr

    "Questions, help and advice for free, small projects by donation. large projects by quote"

    http:\\www.ExcelVBA.joellerabu.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •