title: Find and output empty cells
body: <p>The table contains column G = City, H = Department and J = Date. In the columns J Date some values are missing. I want to output these rows on a new worksheet with (column A) the rownumber, (column B) the city and (column) the departement.</p>
  <p><a href="https://i.stack.imgur.com/sfk8s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sfk8s.png" alt="enter image description here" /></a></p>
  <p>The code I have looks like this but in the output all rows with a value in J = Date and the output is in the columns &quot;G, H, J&quot;. I tried to change the columns in the code but I failed.</p>
  <p><a href="https://i.stack.imgur.com/RJll8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RJll8.png" alt="enter image description here" /></a></p>
  <pre><code>Sub missing()
  Dim ws, wsOut As Worksheet
  Set ws = ActiveWorkbook.Sheets(&quot;Table1&quot;)
  Set wsOut = ActiveWorkbook.Sheets(&quot;output&quot;)
  
  lastRow = ws.Range(&quot;G&quot; &amp; Rows.Count).End(xlUp).Row
  lastRowOut = wsOut.Range(&quot;G&quot; &amp; Rows.Count).End(xlUp).Row + 1
  
  For i = 1 To lastRow
      If (ws.Cells(i, 10).Value = &quot;&quot;) _
      And _
      ((ws.Cells(i, 7).Value = &quot;Peking&quot;) Or _
      (ws.Cells(i, 7).Value = &quot;Tokio&quot;) Or _
      (ws.Cells(i, 7).Value = &quot;London&quot;) Or _
      (ws.Cells(i, 7).Value = &quot;Rom&quot;) Or _
      (ws.Cells(i, 7).Value = &quot;Lissabon&quot;) Or _
      (ws.Cells(i, 7).Value = &quot;Panama&quot;) Or _
      (ws.Cells(i, 7).Value = &quot;Budapest&quot;) Or _
      (ws.Cells(i, 7).Value = &quot;Prag&quot;) Or _
      (ws.Cells(i, 7).Value = &quot;Dublin&quot;) Or _
      (ws.Cells(i, 7).Value = &quot;Luxemburg&quot;)) _
      And _
      ((ws.Cells(i, 8).Value = &quot;A&quot;) Or _
      (ws.Cells(i, 8).Value = &quot;B&quot;) Or _
      (ws.Cells(i, 8).Value = &quot;C&quot;) Or _
      (ws.Cells(i, 8).Value = &quot;D&quot;) Or _
      (ws.Cells(i, 8).Value = &quot;E&quot;) Or _
      (ws.Cells(i, 8).Value = &quot;F&quot;) Or _
      (ws.Cells(i, 8).Value = &quot;G&quot;) Or _
      (ws.Cells(i, 8).Value = &quot;H&quot;) Or _
      (ws.Cells(i, 8).Value = &quot;I&quot;) Or _
      (ws.Cells(i, 8).Value = &quot;J&quot;)) _
      Then
          wsOut.Range(&quot;B&quot; &amp; lastRowOut &amp; &quot;:C&quot; &amp; lastRowOut).Value = ws.Range(&quot;G&quot; &amp; i &amp; &quot;:H&quot; &amp; i).Value
          wsOut.Range(&quot;A&quot; &amp; lastRowOut).Value = i
          lastRowOut = lastRowOut + 1
      End If
  Next i
  </code></pre>
  <p>End Sub</p>