+ Reply to Thread
Results 1 to 7 of 7

Conditional Formatting - using Time (or NOW())

  1. #1
    Registered User
    Join Date
    05-07-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2010
    Posts
    33

    Conditional Formatting - using Time (or NOW())

    Is it possible prevent depending on current time, using conditional formatting or is this VBA?

    I would like to prevent a user from editing a cell (or small group cells) if the time NOW() is less than 24 hours of the time displayed in the reference cell (top cell of the column).

    For instance 7 columns with a start time in the top cell, every two hours; 8:00, 10:00, 12:00, 14:00, etc. A user would be allowed to enter data if more than 24 hours but the cells become frozen or password protected form change if lesss than 24 hours.


    Regards
    Last edited by Apache_sim; 07-09-2013 at 10:29 AM.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Conditional Formatting - using Time (or NOW())

    Hi Apache_sim,

    You can have a now() function in a cell and then you can have time difference in another cells... now you can lock required cells till the time difference is not equal to or greater than 24... this is just a simple logic statement which I have written.. doing practically may involve little bit of modifications

    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Registered User
    Join Date
    05-07-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Conditional Formatting - using Time (or NOW())

    hi dilipandey,
    Thanks for the reply, I think I can write the formulae to copmare the time diffrence, what I can't see is how to prevent the cells from being editied inside of the 24 hours.

  4. #4
    Registered User
    Join Date
    05-07-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Conditional Formatting - using Time (or NOW())

    I can't see what Dilipandy was suggesting .

    The attached doc represents a daily schedule.

    I have used condidtional formating to fill for each session and session type.

    The start time for each session is fixed i.e. G4 = 08:00.
    I would like to be able to compare the current time with the start time in G4 and if less than 24 hours remain to that start time, then prevent further edits by protecting the cells.

    I have been looking at condidtional formating but can't see a suitable option.

    Regards
    Attached Files Attached Files

  5. #5
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Conditional Formatting - using Time (or NOW())

    my bad that I am not clear... let's see what others has to say. thanks.


    Regards,
    DILIPandey
    <click on below * if this helps>

  6. #6
    Registered User
    Join Date
    05-07-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Conditional Formatting - using Time (or NOW())

    I think I have worked most of it out....
    DATE includes the TIME as 00:00:00 by adding the start TIME of the session and checking to see if it is < NOW() seams to work....

  7. #7
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Conditional Formatting - using Time (or NOW())

    That's great...

    Thanks for sharing the solution.

    Regards,
    DILIPandey
    <click on below * if this helps>

+ 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