Using Microsoft's Excel Interop I am reading a spreadsheet. I have no problems getting the used range for the entire sheet, but I want to get the number of rows used for one column only. Here is an example of my sheet:
As you can see, the used range for Column A is only 3 rows, whilst for Column B it is 5 rows. When I used my current code:
int rows = sheet.UsedRange.Rows.Count;
..it always returns "5". How do I specify that I only want the used range for one cell?