+ Reply to Thread
Results 1 to 16 of 16

Calendar Population... macro?

  1. #1
    Registered User
    Join Date
    04-15-2012
    Location
    Open Ocean
    MS-Off Ver
    Excel 2003
    Posts
    12

    Calendar Population... macro?

    All,
    First off thanks for all the great ideas in the past. I thought I had some good ideas on how to do my current project, but I'm finding myself at a loss. I would like to be able to populate a calendar with training topics (I'm in the Navy) listed on a long range training plan (LRTP), encompassing the entire year. The problem is this LRTP is based on approved instruction so I have to keep the format of months, x's, etc. I would also like my Training Petty Officers to be able to select what days in a week their people conduct training. So in other words they populate the LRTP with X's under what month something is conducted and in no particular order, other than only occurring on previously selected training days, those items (training topic and number) get populated into the calendar, which is later approved by their leadership. Like I said, I had some good ideas involving MATCH, VLOOKUP and RAND. However I forgot RAND changes every time you open the spreadsheet. I'm at the limits of my knowledge, especially if this requires a MACRO. Any ideas!?

    Example posted. I used MS Office 2003. Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Calendar Population... macro?

    hi emfc00,

    questions:

    1. What is the expected result for April sheet would be and why?
    2. What is the overall result expected: all months schedule?
    3. If Monday, Wednesday, Friday are selected how do you spread trainings between them (assume it is 4 for April)
    Last edited by watersev; 04-18-2012 at 07:52 AM.

  3. #3
    Registered User
    Join Date
    04-15-2012
    Location
    Open Ocean
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Calendar Population... macro?

    Watersev,
    Answers to your questions (I hope):
    1. The result for the April sheet would be that its populated with both Topic Name and Number in accordance with the LRTP. Presenter and integration would be filled in manually. The reason for this is to save time and manhours. As our schedule continuously changes so do our needs and abilities for training. If I can save my 58 training petty officers an hour or more a week then that is a lot of time I can use them for something else.
    2. I would like all months scheduled. I didn't include all months due to my limited bandwidth. We submit yearly, quarterly and monthly plans... and often.
    3. I would like them spread amongst the first available days. For example if its MWF and they only have four entered on the LRTP then it will only fill (for April) Monday, Wednesday, Friday, Monday. They always fill each available training day so they can adjust the LRTP as necessary if a new training opportunity presents itself due to how the month falls out.

    If I missed the mark on your questions please let me know. Thanks!

  4. #4
    Registered User
    Join Date
    04-15-2012
    Location
    Open Ocean
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Calendar Population... macro?

    Watersev,
    Answers to your questions (I hope):
    1. The result for the April sheet would be that its populated with both Topic Name and Number in accordance with the LRTP. Presenter and integration would be filled in manually. The reason for this is to save time and manhours. As our schedule continuously changes so do our needs and abilities for training. If I can save my 58 training petty officers an hour or more a week then that is a lot of time I can use them for something else.
    2. I would like all months scheduled. I didn't include all months due to my limited bandwidth. We submit yearly, quarterly and monthly plans... and often.
    3. I would like them spread amongst the first available days. For example if its MWF and they only have four entered on the LRTP then it will only fill (for April) Monday, Wednesday, Friday, Monday. They always fill each available training day so they can adjust the LRTP as necessary if a new training opportunity presents itself due to how the month falls out.

    If I missed the mark on your questions please let me know. Thanks!

  5. #5
    Registered User
    Join Date
    04-15-2012
    Location
    Open Ocean
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Calendar Population... macro?

    Would it be easier if I adjusted the "month" sheets to be adjusted for "by day" basis? Meaning I could go to April and "mark" in some way which days I want available for training instead of placing a blanket "MWF" or "TR"?

  6. #6
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Calendar Population... macro?

    please check attachment, press "Create schedule" button.

    You'll need to input year the schedule is created for.

    The schedule will consist of 12 months, a sheet for every month. Prior creating sheets the code would delete any sheet named with 3-letter month shortname. For the code to work you need to keep "Template" sheet in the file.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    04-15-2012
    Location
    Open Ocean
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Calendar Population... macro?

    This looks amazing! I consider my self savvy on Excel but this is a whole other level! I really need to learn to code!! Thanks!!!

    I just have one question. Is there a way to make it so cells C3 and B4, E3 and D4 and so on (basically the top of each day), don't clear when being copied from the template? The reason I ask is I would eventually like to add a function that draws from a list (the at least I know how to do) of important days, ie holidays, underway periods etc. I tried with this template then realized there was a function in the code that clears the cell. I thought I had it figured on how to change it, but it didnt work.

    Thanks so much for your help! Pure magic!!

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Calendar Population... macro?

    You shouldn't bneed VBA to do this. I usually have everything set up as a database then populate a Calendar with formulas. I haven't an example at the moment but I'll try later to add one.
    Last edited by royUK; 04-19-2012 at 08:13 AM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  9. #9
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Calendar Population... macro?

    @emfc, will the formula for C3, E3, G3 ... be the same? Does the same apply for B4, D4, F4 ...? If yes, can you specify both formulas?
    @Roy, retired???

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Calendar Population... macro?

    I have quit admin

  11. #11
    Registered User
    Join Date
    04-15-2012
    Location
    Open Ocean
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Calendar Population... macro?

    Well B4 would contain:

    Please Login or Register  to view this content.
    D4 would contain:

    Please Login or Register  to view this content.
    I will do something similar with C3 and E3 except that I'm unsure of how to base it off a list that contains date ranges:

    For example if I put on my events list

    Start Date End Date
    1/1/12 1/10/12
    2/1/12 2/10/12

    All dates from 1-10JAN12 will show "U/W" and so will 1-10FEB12.

  12. #12
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Calendar Population... macro?

    Does the Events list have regulated data table format or you can change it to your discretion?

  13. #13
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Calendar Population... macro?

    can you post a file with events list sample?

  14. #14
    Registered User
    Join Date
    04-15-2012
    Location
    Open Ocean
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Calendar Population... macro?

    The format can stay the same. But our schedule is extremely fluid so I need to be able to change the data within often.
    Attached Files Attached Files

  15. #15
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Calendar Population... macro?

    I've changed the way the date is outputed to the month sheets, it will not disturb your formulas as per your request
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    04-15-2012
    Location
    Open Ocean
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Calendar Population... macro?

    Thanks for all the help! Its looking pretty hot!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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