 | WorksheetGetLastColumnNumber Method |
Gets the last existing column number in the current worksheet (zero-based)
Namespace: NanoXLSXAssembly: NanoXLSX (in NanoXLSX.dll) Version: 2.6.5+4f4b44a718a20dda8ca2c0c4d00bd7eee7c80f5d
Syntaxpublic int GetLastColumnNumber()
Return Value
Int32Zero-based column number. In case of an empty worksheet, -1 will be returned
RemarksGetLastColumnNumber() will not return the last column with data in any case. If there is a formatted (or with the definition of AutoFilter,
column width or hidden state) but empty cell (or many) after the last cell with data,
GetLastColumnNumber() will return the column number of this empty cell. Use
GetLastDataColumnNumber in this case.
See Also