I am trying to figure out a way in VBA to lock cells in columns A:C if the corresponding cell for that row in column D reads "Complete". So If D2 reads "Complete", A2:C2 will be locked, if D3 reads "Complete" then A3:C3 will be locked, and so on. Similarly, if D2 reads "Open" or is blank, cells A2:C2 would not be locked/ would be unlocked.
In my workbook, cells in column A can only be a date, cells in column B can only be a time, cells in column C can be any text value, and cells in column D can be "Open", "Complete", or blank.
I have seen some VBA codes to lock the entire sheet based on the value of a cell, and a code that locked a few cells in a column based on a cell, but have not been able to find anything that would work row by row like this. I have also seen a solution using data validation, but since cells A and B already have a data validation restricting to date and time I cannot get this alternative method to work.
In my workbook, cells in column A can only be a date, cells in column B can only be a time, cells in column C can be any text value, and cells in column D can be "Open", "Complete", or blank.
I have seen some VBA codes to lock the entire sheet based on the value of a cell, and a code that locked a few cells in a column based on a cell, but have not been able to find anything that would work row by row like this. I have also seen a solution using data validation, but since cells A and B already have a data validation restricting to date and time I cannot get this alternative method to work.