title: Finding last row containing data not working - possible problem with table formatting
body: <p>I've got a sheet called MachineData and I've got the following code</p>
  <pre><code>Worksheets(&quot;MachineData&quot;).Activate
  
  'Last row with data on column AD (30)
  lrow3 = Cells(Rows.Count, 30).End(xlUp).Row
  </code></pre>
  <p>The problem, is that lrow3 returns 2166 when it should return 1 because that's the last row on that column that contains data.</p>
  <p>This column was added next to a table containing data that I extracted from a database. I believe that because the data was extracted from the database then this table has some weird formatting that makes this function not work.</p>
  <p>My question is, how can I change the formatting of my table so this doesn't happen? or is there a way to change my code so this doesn't happen within this table?</p>
  <p>Here is a picture of what my column looks like, anything below &quot;File Name&quot; is empty. I just get those green and white cell colours as this is part of the larger table.</p>
  <p><a href="https://i.stack.imgur.com/ahzSe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ahzSe.png" alt="enter image description here" /></a></p>