title: Excel VBA Deleting Rows if Cells contain values
body: <p>This is a part of a project I'm working on. It needs to look for the values in cells of the same row as the column I am checking. If it's No in A or empty in B, it needs to delete the row. It doesn't work but I don't understand why. Ay thoughts because I am really stuck?</p>
  
  <pre><code>`wb1.Worksheets("Loc").Activate
  For Z = 1 To iNbKids
  rGeo1 = "a" &amp; Z
  rGeo2 = "b" &amp; Z
  If wb1.Worksheets("Loc").Range(rGeo1).Value = "No" Then
  ActiveSheet.Rows(Z).Select
  Selection.Delete
  ElseIf wb1.Worksheets("Loc").Range(rGeo2).Value = " " Then
  ActiveSheet.Row(Z).Select
  Selection.Delete
  End If
  Next Z`
  </code></pre>