+ Reply to Thread
Results 1 to 21 of 21

Populate a calendar from a table

  1. #1
    Registered User
    Join Date
    06-26-2015
    Location
    Oxford, UK
    MS-Off Ver
    Excel 2013
    Posts
    10

    Populate a calendar from a table

    Hi and thanks everyone.

    I am creating a calendar for accommodation (arround 100 beds). Here is a sample of the main part of it. I was so happy to learn about index an match functions, very nice, until I typed this last line in yellow in the table.
    Table to Calendar.png

    Raymond do not appears on the calendar, it looks like the match stops at the first Room2 it meets.

    Whilst I am still searching that would be such a relief if someone would tell me how to do it.

    Thanks and regards
    Gerard

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Populate a calendar from a table

    Please attach your actual Excel file so we can use your data, and possibly update your file with a solution.

    There are probably ways to do this with formulas. However, my first thought is why not just enter your data into the table on the right to begin with, rather than using the table on the left at all?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    06-26-2015
    Location
    Oxford, UK
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Populate a calendar from a table

    Hi Jazzer, thanks for your quick answer!
    Here is the excel file.

    We receive information to fill our calendar in the form of the left table, this is why we do it this way.

    Best regards
    Gerard

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Populate a calendar from a table

    You already have VBA in this file so I put together a VBA solution. Any time you add or update a row of data in columns A-D, the data will be updated in the grid.

  5. #5
    Registered User
    Join Date
    06-26-2015
    Location
    Oxford, UK
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Populate a calendar from a table

    Hi Jazzer,

    I am amazed how quickly and perfectly you solved my problem. I prefer the VBA solution then formulas in all the calendar.
    All the people here send you many many thanks, it is so generous of you to spend time just to help.

    Can't give much in return for now
    Best wishes
    Gerard

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Populate a calendar from a table

    I'm glad I was able to help, and glad that it did in fact solve your problem. It was kind of interesting and I always learn something myself when I do these.

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Populate a calendar from a table

    BTW if your question has been answered please mark your thread as "Solved" so that members will know by looking at the thread title that your problem is solved. Go to the menu immediately above your first post to the thread and click on Thread Tools. From the dropdown menu select "Mark this thread as solved..."

  8. #8
    Registered User
    Join Date
    06-26-2015
    Location
    Oxford, UK
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Populate a calendar from a table

    Thanks 12StringJazzer I was looking for the Solved button this morning.

    I just like to add about the characteristics of your precious VBA:
    1) if you shift the dates of the calendar, all the data in it follow which is super great. However It happens only after you do something in the left table. I didn't understand yet when the update is made.
    2) if you set arrival date for Raymond on the 30/06/15 it will overlap on Nigel, which is really good for me because occasionally a new guest occupies a room the same day the previous guest leaves it. But if it is a mistake, then
    it would be good to Notify: "There is an overlap, accept or cancel".
    If you set Nigel's departure on the 2/07/15 it do not overlap Raymond.

    I am not yet able to understand enough to solve these two questions. Can you still help?
    The other codes in the file are not from me, was left from a previous download.

    Gerard

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Populate a calendar from a table

    We are moving from "I need help with a solution I am developing" to "My problem is getting bigger and I need someone to do the whole thing for me."

    I can't make the time commitment to address the things you have listed here. Are you doing this as part of running a real business? If so, then consider paying the person who provides this tool for you. You can post your question to our Commercial Services forum, where you can offer payment to the person who provides the final solution. If you do this, make sure that you specify all your requirements up front.

  10. #10
    Registered User
    Join Date
    06-26-2015
    Location
    Oxford, UK
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Populate a calendar from a table

    Hi Jazzer as I said in my introduction to the forum, I'm a volunteer in a charitable organization at the Global Retreat Centre Oxford UK, see globalretreatcentre.org and peaceintheparkfestival.org. I come from Switzerland. I am working in the maintenance of the building and beside that I want to make this accommodation calendar which output info for kitchen, cleaning, heating etc. because Brigitte who do the job becomes mad doing it in a archaic way. I am nearly there only thanks to all the things I learned and downloaded from people sharing like you. Your contribution to the project is the best bit. I can use your code as it is. Thanks again.
    If you come to UK we invite you to visit the Global Retreat Centre and have a meal and stay for a night if accommodation available. Just ask for Gerard Ebener.
    I saw your music room, I as well love guitars and play a bit.
    Last edited by Gerard.GRC; 06-30-2015 at 05:40 PM.

  11. #11
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Populate a calendar from a table

    In that case let me take another look. I would be happy to contribute my efforts to a good cause.

  12. #12
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Populate a calendar from a table

    1) if you shift the dates of the calendar, all the data in it follow which is super great. However It happens only after you do something in the left table. I didn't understand yet when the update is made.

    The entire calendar is updated automatically if anything in the table on the left changes. For a row in the table on the left to be considered, it must have all four columns filled in. I have added a button to manually force the entire calendar to be updated, if you change the calendar on the right. It is not easy to make this automatic because I don't know how you are going to add or delete rows, or add or delete columns. So there is a button to do it manually.

    2) if you set arrival date for Raymond on the 30/06/15 it will overlap on Nigel, which is really good for me because occasionally a new guest occupies a room the same day the previous guest leaves it. But if it is a mistake, then
    it would be good to Notify: "There is an overlap, accept or cancel".
    If you set Nigel's departure on the 2/07/15 it do not overlap Raymond.

    There are two ways to do this. The easiest one is to adopt a convention where if a person's name in a box, they have the room for that night. The last date for a person is the last night they will occupy the room. So the previous guest leaving that day would not have his name in the box. This is what I usually see when booking a hotel room. I have done this in the attached file.

    The other (fancy) way to do it is to show both names in the box, with a diagonal line. I have seen this also. I am sure this would be very helpful and I'll take a look at that for tomorrow.

    I have also added an overbooking check.

  13. #13
    Registered User
    Join Date
    06-26-2015
    Location
    Oxford, UK
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Populate a calendar from a table

    That's wonderfull Jazzer, it works perfectly. If on top you do the trick with the diagonal line I think she is going to faint, I'll tell her it's from Jeff. I especially appreciate the speed you can answer with. It's Jazz. Sincerely big thanks!

  14. #14
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Populate a calendar from a table

    This isn't as clean as I would like but have a look and let me know if this is an improvement, or just creates clutter.

  15. #15
    Registered User
    Join Date
    06-26-2015
    Location
    Oxford, UK
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Populate a calendar from a table

    Yes it would be cleaner if the diagonal line would appear only on the day there is an overlap and not on all the arrival and departure dates. Yet It is very good, between this one and the previous which lists the overlaps (fantastic feature!) you have done the job.

    Now I am implementing your VBA in our project and have tried to convert the way you work with columns into working with named range. i.e. in Cells(R, "A") "A" would be the range NAME (A2:A1048576). Didn't managed yet.

    There is an other retreat centre which probably will be interested by this project. I emailed them this morning. It is not too fare from you http://www.peacevillageretreat.org/. So you may receive even more good vibes.

  16. #16
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Populate a calendar from a table

    Quote Originally Posted by Gerard.GRC View Post
    Yes it would be cleaner if the diagonal line would appear only on the day there is an overlap and not on all the arrival and departure dates.
    Hmm... The advantage to always showing the diagonal is that you can clearly see at a glance what is available. For example, if you do not show the diagonal on a date having only a departure, then it won't be clear that the date is available for an arrival. I'll give it a think.

  17. #17
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Populate a calendar from a table

    Now I am implementing your VBA in our project and have tried to convert the way you work with columns into working with named range. i.e. in Cells(R, "A") "A" would be the range NAME (A2:A1048576). Didn't managed yet.
    Cells(R, "A") means "the cell in row R and column A". I do not see why you would need a name for the range A2:A1048576.

  18. #18
    Registered User
    Join Date
    06-26-2015
    Location
    Oxford, UK
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Populate a calendar from a table

    I thought it is better to work with ranges names because in case I insert a column I would have to change "A" in "B" everywhere.

  19. #19
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Populate a calendar from a table

    The code I wrote does not actually refer to the range A:A, so one way to insulate from changes is this. Create a named range for A1. In my example I'll call it NameCol. Then in the code:

    Please Login or Register  to view this content.
    There are other ways to do this too, that's just the one that has the least impact on the code.

  20. #20
    Registered User
    Join Date
    06-26-2015
    Location
    Oxford, UK
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Populate a calendar from a table

    Great I try that

  21. #21
    Registered User
    Join Date
    06-26-2015
    Location
    Oxford, UK
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Populate a calendar from a table

    Yes thanks to all the answer I have been given, I have the solution to achieve the project I am working on.
    Thanks a lot Jazzer

+ 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. [SOLVED] Auto Populate Calendar from Table Excel
    By Corocotan in forum Excel General
    Replies: 15
    Last Post: 12-10-2020, 02:13 AM
  2. Populate an Excel calendar template with events from a separate table
    By Dana_Carter in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-12-2014, 12:14 PM
  3. Populate monthly calendar with table
    By Marco-Kun in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 08-08-2014, 04:18 AM
  4. Auto Populate Calendar From Data Table
    By tommy_b in forum Excel General
    Replies: 2
    Last Post: 10-28-2013, 06:04 PM
  5. Replies: 0
    Last Post: 04-25-2011, 04:28 PM

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