title: How to iterate through a variable-column-length range in Excel using VBA
body: <p>For example, if the data in one worksheet looks like:
  <img src="https://i.stack.imgur.com/B0ciW.png" alt="enter image description here"></p>
  
  <p>UsedRange.Columns.Count is 6 which is the maximum column count for all rows.
  Even if I iterate using</p>
  
  <pre><code>For each row in UsedRange.Rows
         For each cell in row.Cells
             ...
         Next cell
  Next row
  </code></pre>
  
  <p>It's still counting 6 for each row.</p>