Grab Cell Ranges From Excel With Python - Python and Excel With OpenPyXL #7

preview_player
Показать описание
In this video I'll show you how to grab a range of cells from an Excel Spreadsheet using Python and openpyxl.

We'll pull specific ranges using a python slice that names the starting cell and ending cell of the spreadsheet that we want to grab.

This will return a tuple full of tuples. So to get to the actual data, we'll need to nest a for loop inside of a for loop, and then call .value on the result.
Рекомендации по теме
Комментарии
Автор

▶️ Watch Entire OpenPyXL ✅ Subscribe To My YouTube Channel:
▶️ See More At: ✅ Join My Facebook Group:

Codemycom
Автор

Thanks John, this was the missing piece on something I was trying to do. In 3 minutes, you just solved my biggest issue.

UnboxEverythingandAnything
Автор

This is a fantastic video, showed me how to program a range of excel cells.

Richkotite
Автор

Hey John,
Really great tutorials on openpyxl so far. Keep it up!!!

sachinsinghal
Автор

You don't have to loop twice to be able to .value the tuple output, you can simple use index values for this.

for cell in range:
print(cell[0].value)

This will work and you won't have to loop twice, which can be a big performance upgrade when dealing with larger files

nkm
Автор

Working on a project rn and very new to python. Just curious if when u print is there a way to print them still in row format and not down a singular column?

ethanbayeh
Автор

Great content, beautiful work. I just have a couple of questions, how can you edit the excel file, that is, add/remove content, say: a word, number or formula. and how can you access other spreadsheets? and, would it be possible to view a formula saved in excel file, say you have a cell that performs some mathematical operation using other cells within the workbook, would you be able to see it from python using openpyxl? and lastly would you be able to use multiple workbooks at the same time, that is, you have a workbook that contains first names and colors like in the example and another workbook containing another information, age and last names for example?

setsototitipana
Автор

How are we able to compile this program with pyinstaller to be executed elsewhere. I would like to be able to execute the file outside of gitbash. How is this possible?

LVWattsPlays
Автор

Man so glad to see you doing this! Do you have any plan to make videos about pandas and data analysis?

asmerbay
Автор

Hi John, Excellent tutorials! Question: If the range is variable from time to time is there a way to get that instead of manually entering 'A1': 'AXX' every time. Can it grab the number of cells like in len() ? Thanks

airsheepfpv
Автор

Thanks for your tutorial, I ran into a problem when I was automating my excel file, I want to fill another column ( date column ) according to the previous column so that it is filled with a condition. How can I do that? Thanks in advance.

AbuAhmedAlsudani
Автор

Hi enjoying your podcast on openpyxl When I try to create my virtual environment source virtual/Source/virt I get source is not recognized as the name of a cmdlet
Thanks

danielbruchez
Автор

is there a way to make the range we select as Page break view so its also printable?
i can do that manually but i wanted to know if OpenPyXL could do it for me

DarkSpeedKiller
Автор

Hi John - thanks for the great content. If I had one request, it would be how to work with Groupings in openpyxl. Specifically, how to extract certain Groupings of data from an .xlsx file. Context: looking to write Groupings from a Workbook into separate Worksheets. Would love to hear if you have a video covering this and/or any recommended resources?

williamtimothy
Автор

Hey, I'm a little late with my question I guess 😅
I have a excel file, which contains a link. In order to access the information(s) I am looking for, I have to first click that link. Any solution for that?

-thanks

holycow
Автор

I'd love more of these
like more complex subjects

PumpkinIssues
Автор

Hello John

I have combobox for excel databank, and it has 300 rows, and 10 columns.
How do i do if i select one object from combobox list, and it gets data from B column.

Like i choose A10 text from combobox, it gets data from B10.
And i need to use that B10 data to calculate things.
I have not able to find tutorial for this.

Thank you, your videos has been so helpful to this point.

-Hannu

Bittinikkari
Автор

What if I want to grab the entire range on a sheet but I don’t know what that range is? For example I want to select the entire data range and then turn on autofilter for that sheet. Worksheet.autofilter()

sondrad
Автор

Hi John - thanks for the great explanations... I'm a bit confused though, you mentioned what you'd be talking about in the next video, but this series ended with #7 and I can't find the next in this series. There are a ton of videos, and maybe I'm just overlooking it, but I don't see the continuation... can you help me out?

exnavydavid
Автор

How to read cell value by using column name and row name?

Example: First column in my excel is row names
By using that row names amd columns names i want to get cell values..

Can you help me?

nazuusyed
join shbcf.ru