+ Reply to Thread
Results 1 to 3 of 3

Coloring the cells according to time

  1. #1
    Registered User
    Join Date
    09-29-2007
    Location
    Lahore, Pakistan
    MS-Off Ver
    2007, 2010
    Posts
    51

    Coloring the cells according to time

    I have a Time Table sheet which contains week days (in columns H to M), class start timing and end timing (in column N & O in attached sheet) and room number (in column P).
    In the same file I have 6 other sheets which are named with week days i-e Mon, Tue onward.
    In these 6 sheets I have time in column B starting from 7:00 AM and increasing by 5 minutes downward in the column till 10:00 PM, and room numbers in row 4.

    A code is designed to pick three variable items i-e days, start and end time and room number from the main Time Table and highlight (with green colour) respective area in the sheets named Mon, Tue onward.

    Example:
    If time table contains a class which is held on Mon, Tue & Wed and starts at 9:00AM and end at 10:30AM and conducted in room number 1, code will pick this information and highlight the cells against timing from 9:00AM to 10:30AM under room number 1 in sheets Mon, Tue & Wed.

    Code works fine but the only problem with it is that it highlights respective area considering 10 additional minutes. So in case of above example it highlights area from 9:00AM to 10:40AM rather till 10:30AM.

    Note: Red coloured cells show that more than one classes are planned in one room in time which is coloured red.

    I hope that I have explained the problem to ease the understanding of Excel experts and anticipating for a solution.
    Attached Files Attached Files

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

    Re: Coloring the cells according to time

    hi, User3, I will not correct existing code as I do not like algorithm it exploits, I can suggest my code to get it done. As far as I understand it works as it should. Please check attachment, run code "test". If there are any issues, please shout.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    09-29-2007
    Location
    Lahore, Pakistan
    MS-Off Ver
    2007, 2010
    Posts
    51

    Re: Coloring the cells according to time

    Thank you so much for your time and effort. I will let you know after working with it.

+ 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