title: VBA Excel if statement for odd & even values
body: <p>I would like to set the IF statement for odd &amp; even values in VBA Excel.</p>
  
  <p>This is an idea, which I got after this query here:</p>
  
  <p><a href="https://stackoverflow.com/questions/60955007/vba-excel-run-some-parts-of-the-code-only-once-when-using-command-buttons">VBA Excel run some parts of the code only once when using command buttons</a></p>
  
  <p>My code is related to another part of the code above and looks as follows:</p>
  
  <pre><code> Public Sub ResizeCiv2()
     ' image autoresize code
     Dim targetSheet As Worksheet
     Dim targetRange As Range
     Dim targetShape As Shape
  
  
    ' Define the sheet that has the pictures
     Set targetSheet = ThisWorkbook.ActiveSheet
     ' Define the range the images is going to fit
     Set targetRange = targetSheet.Range("C3:K24")
  
  
     ' Loop through each Shape in Sheet
      For Each targetShape In targetSheet.Shapes
      ' Check "picture" word in name
      If targetShape.Name Like "*Picture*" Then
          ' Call the resize function
          SizeToRange targetShape, targetRange
      End If
  
     Next targetShape
  
     'elements + numeration code
  
     Dim odd, even As Range
     Set even = ActiveSheet.Range("C51")
     Set odd = ActiveSheet.Range("C52")
  
     If even.Value = "TRUE" Then
     Call CivBox
     Call Divider
     ActiveSheet.Cells(51, 4).Value = ActiveSheet.Cells(51, 4).Value + 1
     End If
     If odd.Value = "FALSE" Then
     ActiveSheet.Cells(52, 4).Value = ActiveSheet.Cells(52, 4).Value + 1
     ActiveSheet.Range("M15").Value = Range("D52")
     End If
  
    End Sub
  </code></pre>
  
  <p>No error, but no reaction at all.
  I want to have this condition working.
  <a href="https://i.stack.imgur.com/gsu8y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gsu8y.png" alt="enter image description here"></a></p>
  
  <p>Basically I set the <strong>ISEVEN</strong> function for adjacent columns (C51 and C52), which in relation accordingly to D51 and D52 returns TRUE or FALSE. I would like to use this value in my IF statement. I don't understand why doesn't it work? Shall I write the VBA code for odd &amp; even values?</p>