Reputation: 1
I tried using like this,
sheet.get_highest_row()
but the output was 104578
I have only 3 rows in my excel sheet. I need to select only the number of rows present in the Excel sheet
Upvotes: 0
Views: 2312
Reputation: 133
To get the number of rows, you simply get the property max_row
from the worksheet object:
rows = sheet.max_row
print(rows)
In your case, it prints 3
.
Upvotes: 1
Reputation: 3513
Open the file in Excel and press Ctrl-End. This will select the last cell according to Excel. This is probably an empty cell somewhere in row 104578. If this is the case, select all empty rows in Excel, delete and save. This should update the last row.
Upvotes: 1