title: IF Statement For Active Row (worksheet_change)
body: <p>I have an Excel template with an table where I calculate a couple of recommended values (Column I, J &amp; K). Then the user selects the value they want from an data validation dropdown-list in (Column L).</p>
  
  <p>If the user selects a value that are &lt;= 6 units from the min recommended value I would like to show a message box just telling that "your selected value are low", and just continue without action.</p>
  
  <p>And if the user selects a value that are &lt; 3 units from the min recommended value I would to show a message box telling that "your selected value are to low, select another value" and clear the active cell where they select their values.</p>
  
  <ul>
  <li>Column I = Recommendation</li>
  <li>Column J = Deviation from the recommendation &lt;= 6</li>
  <li>Column K = Deviation from the recommendation &lt; 3</li>
  <li>Column L = User selection</li>
  </ul>
  
  <p><strong>So dream scenario would be:</strong></p>
  
  <ol>
  <li><p>User selects a value that are > 6 units from recommendation, do nothing</p></li>
  <li><p>User selects a value that are &lt;= 6 units from the recommendation, reminder that they are close</p></li>
  <li><p>User selects a value that are &lt; 3 units from the recommendation, clear the users selection and tell them to select a greater value.</p>
  
  <p>Private Sub worksheet_change(ByVal target As Integer)
      Dim target As Integer</p>
  
  <pre><code>For target = 2 To 1000
      If Cells(target, 12).Value &lt;= Cells(target, 9).Value Then
      MsgBox ("Your selection are close to the recomandation")
          ElseIf Cells(target, 12).Value &lt; Cells(target, 11).Value Then
          MsgBox ("Your selection are to low, pick a higher value")
          ActiveCell.Clear
              Else: exitsub
              End If
  </code></pre>
  
  <p>End Sub</p></li>
  </ol>