Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Inserting Columns

Francois Botha edited this pageFeb 26, 2018 ·4 revisions

Create a new worksheet and fill some cells

varworkbook=newXLWorkbook();varws=workbook.Worksheets.Add("Inserting Columns");// Color the entire spreadsheet using columnsws.Columns().Style.Fill.BackgroundColor=XLColor.LightCyan;// Put a value in a few cellsforeach(varrinEnumerable.Range(1,5))foreach(varcinEnumerable.Range(1,5))ws.Cell(r,c).Value="X";

InsertingColumnsInitial.jpg

Now let's play inserting rows to the worksheet and ranges

varblueColumn=ws.Column(2);varredColumn=ws.Column(5);blueColumn.Style.Fill.BackgroundColor=XLColor.Blue;blueColumn.InsertColumnsAfter(2);redColumn.Style.Fill.BackgroundColor=XLColor.Red;redColumn.InsertColumnsBefore(2);ws.Rows(3,4).Style.Fill.BackgroundColor=XLColor.Orange;ws.Range("B1:D1").InsertColumnsAfter(2);ws.Range("B2:D2").InsertColumnsBefore(2);ws.Range("B3:D3").InsertColumnsAfter(2);ws.Range("B4:D4").InsertColumnsBefore(2);workbook.SaveAs("InsertingColumns.xlsx");

InsertingColumnsFinal.jpg

FAQ

Examples

Real world scenarios

Time Savers

Performance and Memory

Misc

Inserting Data/Tables

Styles

Ranges

Rows

Columns

Page Setup (Print Options)

AutoFilters

Comments

Dev docs

Clone this wiki locally


[8]ページ先頭

©2009-2025 Movatter.jp