+ Reply to Thread
Results 1 to 4 of 4

Protect Range from change based on specific Date on another Range

  1. #1
    Registered User
    Join Date
    03-16-2015
    Location
    Egypt
    MS-Off Ver
    2010
    Posts
    51

    Protect Range from change based on specific Date on another Range

    hi all
    I'm having trouble trying to figure out how to Protect Range from change After specific Date
    I have 2 Ranges
    First one : Sheets("Sheet1").Range("B2:B10,F2:F10") with data
    the second : Sheets("Sheet1").Range("C2:C10,G2:G106") with date

    my request is : Protect each cel in Range("B2:B10") based on date in Range("C2:C10")
    Protect each cel in Range("F2:F10") based on date in Range("G2:G10")

    eg : if the date which in C2 < today Date then Protect B2 from change
    if the date which in C3 < today Date then Protect B3 from change
    and so on

    if the date which in C2 >= today Date then unProtect B2 from change
    if the date which in C3 >= today Date then unProtect B3 from change
    and so on

    note : the protection must be on Range("B2:B10,F2:F10") not others

    Can anyone help me with it please??

    thanks in advance

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,775

    Re: Protect Range from change based on specific Date on another Range

    Start by unlocking the four ranges in columns B, C, F and G. Then protect the worksheet. Copy and paste this macro into the worksheet code module. Do the following: right click the tab for your sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Enter a date in columns C and G.
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    03-16-2015
    Location
    Egypt
    MS-Off Ver
    2010
    Posts
    51

    Re: Protect Range from change based on specific Date on another Range

    Thanks a lot Mr. mumps1 for this code
    I'm sorry for being late in my reply ..
    I was creatting a another code and it works for me.
    HTML Code: 
    thank you so much

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,775

    Re: Protect Range from change based on specific Date on another Range

    Glad it worked out.

+ 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. [SOLVED] Altering Code to Change Date Value on Row Updated (Want to Set a Specific Range)
    By nKife in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-19-2015, 05:11 PM
  2. copying specific range from one workbook to another in specific range based on condition
    By ankitgoyalhsr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-16-2015, 03:46 AM
  3. Replies: 5
    Last Post: 01-05-2015, 03:57 PM
  4. Populate a specific range based on calendar date
    By gottnoskill in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-28-2014, 03:19 PM
  5. Copy and paste specific range to date specific range in alternate sheet
    By alanalmarza in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2013, 08:29 AM
  6. Change all dates in a specific date range
    By akhilash in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-13-2009, 01:01 PM
  7. [SOLVED] Change text color of specific date range by macro in Excel
    By Morgan LeFay in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-03-2006, 02:55 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