Well, you are currently checking to see if the cell size is zero. In a grid, each cell in a column has the same width, and each cell in a row has the same height (usually anyway).
You want to check based on cell value. For example:
if (cell.Value == null || cell.Value.Equals("")) { continue; }
Change this for any other representations of "empty" values ββthat interest you. If there are a lot of them, you can write a specific method for it and call it on the check:
if (IsEmptyValue(cell.Value)) { continue; }
Jon skeet
source share