+ Reply to Thread
Results 1 to 4 of 4

Macro to lock rows based on two conditions

  1. #1
    Registered User
    Join Date
    08-13-2012
    Location
    Woodbury,CT
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2301 Build 16.0.16026.20002) 64-bit
    Posts
    67

    Macro to lock rows based on two conditions

    I have a sheet with 9 columns and 1,000 rows. The first two rows are Title and column headers and are always locked.
    Column I, containing a formula, is always locked.

    I would like to lock the other columns A thru H in each row 3 thru 1,000 where the following conditions are true:
    Col. A (Date) is more than 10 days in the past, and
    Col. F contains an "x"

    I've spent the best part of the weekend trying to figure this out and have come to the conclusion its time to ask for help.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Macro to lock rows based on two conditions

    Use something like this to lock a specific row:
    Please Login or Register  to view this content.
    Now, you can call this for all rows in your range, with something like:
    Please Login or Register  to view this content.
    And / or you can do this dynamically as the worksheet changes, by putting this in the worksheet module:
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    08-13-2012
    Location
    Woodbury,CT
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2301 Build 16.0.16026.20002) 64-bit
    Posts
    67

    Re: Macro to lock rows based on two conditions

    Thanks for your response. I will see what I can do with these suggestions.

  4. #4
    Registered User
    Join Date
    08-13-2012
    Location
    Woodbury,CT
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2301 Build 16.0.16026.20002) 64-bit
    Posts
    67

    Re: Macro to lock rows based on two conditions

    Thanks for your response. I will see what I can do with these suggestions.

+ 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] Macro to Delete Rows based on Specific Conditions
    By stockgoblin42 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-28-2013, 05:29 PM
  2. Macro Needed to Auto-Populate Rows Based on the Conditions of a Cell
    By lago3525 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-11-2012, 04:35 PM
  3. lock/unlock rows based on values in cell
    By aravindhan_31 in forum Excel General
    Replies: 5
    Last Post: 06-14-2012, 03:33 PM
  4. Deleting rows based on conditions being met
    By sharrukin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-29-2011, 04:12 AM
  5. Lock rows based on value in another column
    By pumped in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-15-2010, 11: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