IRONSOFTWAREHOME
Insert New Rows & Columns
using IronXL;

// Load existing spreadsheet
WorkBook workBook = WorkBook.Load("sample.xlsx");
WorkSheet workSheet = workBook.DefaultWorkSheet;

// Add a row before row 1
workSheet.InsertRow(0);

// Insert multiple rows before row 4
workSheet.InsertRows(3, 3);

// Add a column before column A
workSheet.InsertColumn(0);

// Insert multiple columns before column F
workSheet.InsertColumns(5, 2);

workBook.SaveAs("addRowAndColumn.xlsx");
Imports IronXL

' Load existing spreadsheet
Dim workBook As WorkBook = WorkBook.Load("sample.xlsx")
Dim workSheet As WorkSheet = workBook.DefaultWorkSheet

' Add a row before row 1
workSheet.InsertRow(0)

' Insert multiple rows before row 4
workSheet.InsertRows(3, 3)

' Add a column before column A
workSheet.InsertColumn(0)

' Insert multiple columns before column F
workSheet.InsertColumns(5, 2)

workBook.SaveAs("addRowAndColumn.xlsx")
NuGet Download
PM > Install-Package IronXL.Excel
Insert New Rows & Columns

Insert New Rows & Columns

IronXL library allows the ability to insert single & multiple rows and columns in C# code without using Office Interop.

Insert Row

The InsertRow and InsertRows methods enable adding brand-new rows. Using these methods will add row(s) before the specified index position.

Insert Column

Use InsertColumn and InsertColumns methods to add column(s) before the specified index position.

Please note that all the index positions mentioned above follow zero-based indexing.

Learn How to Add Rows & Columns in Excel with C#
View on GitHub

Ready to Get Started?

Nuget Downloads 2,237,574Version: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