+ Reply to Thread
Results 1 to 2 of 2

Trying to write VBA code to generate all possible schedules

  1. #1
    Registered User
    Join Date
    09-12-2016
    Location
    USA
    MS-Off Ver
    16
    Posts
    1

    Trying to write VBA code to generate all possible schedules

    Hi, for my Class I have to develop an excel program that would help a college student. I decided to make a program that would generate all the possible schedules of classes they could take.
    I have already designed a dialog and basic code to have someone input the all the class information needed to generate the schedules. Now I am stuck on the algorithm part to have the computer generate the schedules. I can do it it in my head but I am not knowledgeable enough to translate this into VBA code to execute it.

    For example the classes look like this: Headers are (Class Number, Class Section, Name, Days, Start, End)

    1301 01 Business Calc MWF 8:00 AM 8:50 AM
    1301 02 Business Calc MWF 9:00 AM 9:50 AM
    1301 03 Business Calc MW 8:00 AM 9:45 AM
    1301 01 Accounting MWF 9:00AM 9:50 AM
    1301 02 Accounting MWF 10:00 AM 10:50 AM

    ect...

    so pretty much, I would like it to generate all possible schedules without including classes of the same category or scheduling classes within the same time period.
    I would like to be able to have it generate schedules for 15 possible classes but only scheduling 4 classes a day.
    I understand the code will be lengthy so I dont expect full code, but I would appreciate a template or code to get me started on the right algorithm path.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Trying to write VBA code to generate all possible schedules

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 08-27-2016, 06:24 AM
  2. Replies: 3
    Last Post: 05-10-2015, 02:18 PM
  3. Compare schedules and generate a list of missing coverage.
    By DavisDS85 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-31-2014, 05:28 PM
  4. [SOLVED] Code Problem: How to Write this into a VBA code
    By rlkerr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-28-2013, 02:46 AM
  5. [SOLVED] IF Exists or on Error Then - Skip Code- How to write code?
    By Jack7774 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-22-2013, 06:45 PM
  6. Excel to generate a code
    By chidmas in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-29-2012, 12:24 PM
  7. Code to write out all lines of code
    By davidm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-04-2005, 11:26 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1