title: Get last non-empty cell in a row or get last column with a non-empty header in Excel
body: <p>How to get last column in Excel with a non-empty header or cell? In other words, get last non-empty cell in header row of Excel to get the respective column index in number.</p>
  
  <p>Can't really find how to do that in C#. In VBA, it is rather simple using XlToleft.</p>
  
  <p>I am using .NET and Excel interop.</p>