Is there a way to get the number of rows and columns present in a .xlsx sheet using openpyxl?

Is there a way to get the number of rows and columns present in a .xlsx sheet using openpyxl? In xlrd,

     sheet.ncols 
     sheet.nrows

will give the number of columns and rows. Is there such a method in openpyxl?

+4
source share
1 answer

If sheetis the worksheet you want to find, the number of rows and columns you can do:

rows = sheet.max_row
column = sheet.max_column
+8
source

Source: https://habr.com/ru/post/1628828/


All Articles