Results 1 to 3 of 3

Thread: Lock rows with dates 30 days in the future

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Member p45cal's Avatar
    Join Date
    Oct 2013
    Posts
    94
    Rep Power
    11
    Code:
    TodayPlus30 = Date + 30
    Pwd = "pwd"
    With ThisWorkbook.Worksheets("Vertical")
      .Unprotect Password:=Pwd
      .Cells.Locked = False
      For Each cll In .Range("$A$19:$A$448").Cells
        If cll.Value > TodayPlus30 Then cll.EntireRow.Locked = True 'to allow only rows within the defined range to be selected
      Next cll
      .Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:=Pwd, userinterfaceonly:=True
    End With
    Last edited by p45cal; 04-25-2024 at 01:40 PM.

Similar Threads

  1. Insert Missing Dates By Comparing Two Lists Of Dates
    By mahmoud-lee in forum Excel Help
    Replies: 24
    Last Post: 10-16-2013, 04:48 PM
  2. How to Extracting dates and days between 2 dates.
    By Rajesh Kr Joshi in forum Excel Help
    Replies: 9
    Last Post: 08-11-2012, 09:11 PM
  3. Excel Datedif - Days of February
    By Excelfun in forum Excel Help
    Replies: 6
    Last Post: 06-10-2012, 02:32 PM
  4. The Number of Years, Months and Days Between Two Dates
    By Rick Rothstein in forum Rick Rothstein's Corner
    Replies: 7
    Last Post: 06-08-2012, 10:35 PM
  5. Number of Days In A Month
    By Excel Fox in forum Excel and VBA Tips and Tricks
    Replies: 0
    Last Post: 05-14-2011, 08:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •