Skip to content
Advertisement

How to read values from multiple sheets in excel with openpyxl

I have two sheets in one excel file. And I want to read the two values from the two excel sheets.

SO I try it like this:

JavaScript

But it only returns one value from one sheet. And not the two values from the two sheets.

My question is: how to return the two values from the two sheets?

Advertisement

Answer

You are assigning it to the same variable – cell_obj. Please move the print inside the loop.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement