Can you specify exactly how you want to delete rows / records? Are they in the middle of the leaf? Bottom? Upstairs?
I had a situation where I wanted to erase all the data except the headers as soon as I processed them. To do this, I just changed the worksheet twice.
This is a simple brute force solution to clean the entire sheet without removing the worksheet.
Counting Data Rows
One way is to load data in a json object using get_all_records() , and then check the length of this object. This method returns all the lines above the last non-empty line. It will return lines that are empty if the line after it is not empty, and not trailing spaces.
source share