Locked lesson.
About this lesson
In this lesson, we'll discuss how to grab a whole range of cells.
Exercise files
Download this lesson’s related exercise files.
17 - Existing Excel - Cell Range.docx57.2 KB 17 - Existing Excel - Cell Range SOLUTION.docx
55.7 KB
Quick reference
Existing Excel - Cell Range
Sometimes you need to grab just one cell...sometimes you need to grab a whole range of cells.
When to use
Use this method whenever you need to grab a whole range of cells.
Instructions
To grab A2 thru A8, use the cell_range function.
cell_range = ws.['A2':'A8']
To Loop thru the results:
for cell in cell_range:
print(cell[0].value)
Hints & tips
- cell_range = ws.['A2':'A8']
Lesson notes are only available for subscribers.