I have an Excel spreadsheet with many tabs. I’d like to export the last column of each sheet in a text file (all in the same file, the first line of the second sheet must go just after the last line of the fist sheet).
The thing is the number of columns changes from one sheet to another. The number of the last column can be given by the last non empty cell on the first row.
I’ve seen how to write in a file, but I’m clueless on how to iterate over sheets and rows…
Any help is welcome. Thanks.
You can find the last cell in a row using this code:
You can iterate through every Worsheet using the
Worksheetscollection: