title: VBA If statements?
body: <p>I'm using a load of IF statements but I'm 100% sure this can be done better and much shorter (cleaner).</p>
  
  <p>I've been trying to use Google to find a solution but I couldn't find anything that suited my issue.</p>
  
  <p>How can I make the following code cleaner and shorter?</p>
  
  <pre><code>Dim wsTab1 As Worksheet
  Dim wsTab2 As Worksheet
  Dim wsTab3 As Worksheet
  Dim Array1 As Variant
  Dim Array2 As Variant
  Set wsTab1 = Sheets("Tab 1 - Prijslijst")
  Set wsTab2 = Sheets("Tab 2 - Nieuwe prijzen")
  Set wsTab3 = Sheets("Tab 3 - Prijslijst aangepast")
  Array1 = Array("DK", "DL", "DM", "DN", "DO", "DP", "DQ", "DR", "DS", "DT",         "DU", "DV", "DW", "DX", "DY", "DZ", "EA", "EB", "EC", "ED", "CQ", "CR", "CS", "CT", "CU", "CV", "CW", "CX", "CY", "CZ", "DA", "DB", "DC", "DD", "DE", "DF", "DG", "DH", "DI", "DJ")
  Array2 = Array("W", "X", "Y", "Z", "AA", "AB", "AC", "AD", "AE", "AF", "AG", "AH", "AI", "AJ", "AK", "AL", "AM", "AN", "AO", "AP", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V")
  
  For i = 0 To UBound(Array1) 'loop through array
  If wsTab1.Range(Array1(i) &amp; xlCell2.Row).Value &lt;&gt; wsTab2.Range(Array2(i) &amp; xlCell2.Row).Value Then 'do your comparison based on array values
      wsTab3.Range(Array1(i) &amp; xlCell2.Row).Value = wsTab2.Range(Array2(i) &amp; xlCell2.Row).Value
      wsTab3.Range(Array1(i) &amp; xlCell2.Row).Interior.ColorIndex = 4
      wsTab2.Range(Array2(i) &amp; xlCell2.Row).Interior.ColorIndex = 4
  End If
  Next i
  </code></pre>
  
  <p>EDIT: managed to get this ^</p>