+ Reply to Thread
Results 1 to 4 of 4

auto lock rows 6 days after date passed

  1. #1
    Registered User
    Join Date
    07-30-2014
    Location
    auckland, nz
    MS-Off Ver
    2007
    Posts
    2

    auto lock rows 6 days after date passed

    Hi there. I am new to Excel programming, haven't done any before and not familiar with creating/editing macros.

    Using Excel 2007.

    I would like to automatically lock all the cells in a row if the date in column A in that row is >= 7 days old. Data is entered once a week (some time Sunday - Saturday) and I would like historical data (rows) to be locked so that they can't be edited inadvertently.

    If possible could I also highlight the current working week somehow?

    I have attached the worksheet.
    testworksheet.xlsx
    Last edited by dmmcleod; 07-30-2014 at 01:29 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: auto lock rows 6 days after date passed

    try this:
    Please Login or Register  to view this content.
    HTH!

  3. #3
    Registered User
    Join Date
    07-30-2014
    Location
    auckland, nz
    MS-Off Ver
    2007
    Posts
    2

    Re: auto lock rows 6 days after date passed

    Wow, that was quick. It certainly did help, thanks. Thanks so much for this reply and so promptly too, awesome jewelsharma

    Just one thing.... After I run the macro ...Once I have entered data into a cell that is edittable the whole sheet unlocks again(reverts). Is there something I need to do to make the affects of this macro permanant?...... EDITTED.... Oh it seems to be ok now, working fine. Thanks again

    Dave
    Last edited by dmmcleod; 07-30-2014 at 05:04 AM.

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,585

    Re: auto lock rows 6 days after date passed

    Pl see attached file.Entries for dates more than 7 days early and after today not allowed.
    Worksheet_change event is used.
    Attached Files Attached Files

+ 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. Lock cells after Today's date passed (VBA excel code)
    By rt1306 in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 05-16-2013, 12:06 PM
  2. I need to lock cells after date has passed on time shees.
    By Backsurge in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-20-2013, 01:24 AM
  3. Lock cells after today date passed
    By Abdul Haneef in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-13-2012, 07:17 AM
  4. Lock the sheet once date is passed
    By anwitha in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-11-2011, 01:55 AM
  5. Lock cells after Today's date passed (VBA excel code)
    By rt1306 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-27-2009, 01:59 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