title: How to have Excel cell to auto fill data but also prevent users from entering data manually?
body: <p>My Excel sheet have columns which gets data automatically from another sheet</p>
  
  <pre><code>Private Sub worksheet_change(ByVal target As Range) 'Auto fill ccells after Project No is selected
  
   If target.Row &gt; 3 And Not Intersect(target, Columns("A")) Is Nothing Then
      Set rng = Cells(target.Row, 1)
  '----------------------------
      With rng.Offset(0, 1) 'Inv No
         .FormulaR1C1 = "=IFerror(INDEX(D.Entry,MATCH(rc[-1],D.Entry[Project No],0),3),"""")"
         .Value = .Value
      End With
  '-------------------------------
      With rng.Offset(0, 2) 'Description
         .FormulaR1C1 = "=IFerror(INDEX(D.Entry,MATCH(rc[-2],D.Entry[Project No],0),4),"""")"
         .Value = .Value
      End With
  
   End If
  
  End Sub
  </code></pre>
  
  <p>As it is, users always have a tendency to overwrite the data from these cells by accident. So to avoid this, my plan was to protect those cells from being edited using the Protect Sheet function built in Excel. </p>
  
  <p>But after setting the protection settings to include <code>Edit Objects</code> and testing to see if it works, I get runtime error 1004. Unprotecting the sheet, allows the code to function properly.</p>
  
  <p>That said, in this situation, how do I tell Excel to prevent users from editing in specific columns and at the same time allow for auto content filling?</p>