View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick Rothstein \(MVP - VB\) Rick Rothstein \(MVP - VB\) is offline
external usenet poster
 
Posts: 2,202
Default Conditional Formatting to Lock Cells

Is there a way to lock the adjacent cells in a row,
if "contractor" is entered into the cell?


Let's assume the column where the word "contractor" can appear is Column A.
Select the adjacent columns that you wish to lock make sure you start in
Column B so that B1 is the active cell. Click Data/Validation in Excel's
menu bar and, on the dialog box that appears, select "Custom" in the Allow
drop down and put this formula in the Formula field...

=ISERROR(SEARCH("contractor",$A1))

then finish by clicking OK. If "contractor" (any casing) is typed into a
cell in Column A, then nothing will be able to be entered into the same row
in any of the columns you selected for the Data/Validation condition. By the
way, I used the SEARCH function so the letter casing on the word
"contractor" does not matter.

Rick