IRONSOFTWAREHOME
Combine Excel Ranges
from ironxl import *

# Load existing spreadsheet
workbook = WorkBook.Load("sample.xls")
worksheet = workbook.WorkSheets[0]

# Get a range from an Excel worksheet
selected_range = worksheet["A2:A8"]

# Combine two ranges
combined_range = selected_range + worksheet["A9:A10"]

# Iterate over the combined range
for cell in combined_range:
    print(cell.Value)
pip install ironxl
Combine Excel Ranges

Combine Excel Ranges

IronXL for Python provides an efficient way to manipulate Excel files, including the ability to combine Range objects using the + operator.

Using the + operator to combine Range objects is a versatile approach for handling multiple non-contiguous cell groups as a single entity. This is particularly useful when aggregating data from different sections of a worksheet - for example, applying a single formatting rule or calculation across a union of ranges without writing repetitive selection logic.

Explore How to Write to Excel with IronXL for Python

Ready to Get Started?

Version:2026.9just released

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required