+ Reply to Thread
Results 1 to 10 of 10

How to Protect Row If Date is Passed

  1. #1
    Registered User
    Join Date
    07-26-2014
    Location
    india
    MS-Off Ver
    2010
    Posts
    66

    How to Protect Row If Date is Passed

    Dear All

    I have a sheet where there is date column and after that some data column
    I tried so many things but I am unable to lock entire row if date is smaller than todays date
    Please find attached sheet

    I am not aware with any coding So Please give me sample sheet wher I can get the coding and format

    User should be allow to enter or change data, if date in column is todays date
    but he should not change the data or delete data or cell if date is smaler than todays date or
    once the date is passed

    give option for date is smaller than 2 days - todays date

    Please help
    PFA


    Atul
    Attached Files Attached Files

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: How to Protect Row If Date is Passed

    Press Alt+F11 to open VBA Editor --> On VBA Editor Window --> From the project pane on left --> Double click ThisWorkbook --> Paste the code given below in the opened code window --> Close VBA Editor --> Save your workbook as Excel Macro-Enabled Workbook.
    Please Login or Register  to view this content.
    Once you open your workbook, the code will run automatically and user won't be able to edit the data which is two days older from today's date. Like if today is 27/07/2014, user will not be able to modify the data before 25/07/2014.
    Is this what you are trying to achieve?
    Attached Files Attached Files
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Registered User
    Join Date
    07-26-2014
    Location
    india
    MS-Off Ver
    2010
    Posts
    66

    Re: How to Protect Row If Date is Passed

    Yes Champ

    Thanks alot


    Atul

  4. #4
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: How to Protect Row If Date is Passed

    You're welcome. Thanks for the feedback.
    If that takes care of your question, please mark your thread as Solved by selecting Thread Tools (just above your first post) --> Mark thread as solved.

  5. #5
    Registered User
    Join Date
    07-26-2014
    Location
    india
    MS-Off Ver
    2010
    Posts
    66

    Re: How to Protect Row If Date is Passed

    Yes Sure

    Your file wont allow to change date up to today or even cant delete the row. It is very good.
    But I found it allows to change date for 29/07/2014 as 25/07/2014 at user can enter data in edited row

    How to stop that
    Help will be appriciable

    Atul

  6. #6
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: How to Protect Row If Date is Passed

    Please find the attached sheet. Make a change in the Date column (col. A), if the user enters a date which already exists, user will get a warning and will not be allowed to change the date. See if this works as per your requirement.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    07-26-2014
    Location
    india
    MS-Off Ver
    2010
    Posts
    66

    Re: How to Protect Row If Date is Passed

    Thanks for the solution

    Just One thing I am not understanding
    If date is containg 25, 26,28 and 29
    In this case user can enter date 27 it will allow
    because 27 is not available in previous data

    Even If I want to insert rows for Todays Date then it should allow
    to add rows for todays date not for previous or after

    Even If I change system date then it allows to change data

    Anyway you have given that is also usefull for me
    If possible to restrict to enter old date and allow to insert new row for currant date
    then please do.

  8. #8
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: How to Protect Row If Date is Passed

    See the attached sheet.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    07-26-2014
    Location
    india
    MS-Off Ver
    2010
    Posts
    66

    Re: How to Protect Row If Date is Passed

    Thanks

    Please let me know is it possible to insert row for same date
    and what about If I change system date. Now it allow to make changes
    How can we restrict that?

    You have rally helped me good
    Atul

  10. #10
    Registered User
    Join Date
    07-26-2014
    Location
    india
    MS-Off Ver
    2010
    Posts
    66

    Re: How to Protect Row If Date is Passed

    Waiting for your reply

    Atul

+ 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. Formula to add x months to a date when the date has passed.
    By adamliq in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-30-2013, 10:06 PM
  2. Column Protect if Current Date is Passed
    By Abdul Haneef in forum Excel Programming / VBA / Macros
    Replies: 28
    Last Post: 06-13-2012, 11:30 AM
  3. how to hide row once date has passed
    By glyndennett in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 04-17-2011, 09:50 AM
  4. Date passed = Highlight
    By simon3163 in forum Excel General
    Replies: 6
    Last Post: 11-17-2010, 05:28 PM
  5. Replies: 1
    Last Post: 03-22-2010, 04:09 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