8000 Transpose Ranges · ClosedXML/ClosedXML Wiki · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Transpose Ranges

Francois Botha edited this page Feb 26, 2018 · 2 revisions

Transpose Ranges

We start with the basic table:

BasicTable.jpg

var workbook = new XLWorkbook("BasicTable.xlsx");
var ws = workbook.Worksheet(1);

var rngTable = ws.Range("B2:F6");

rngTable.Transpose(XLTransposeOptions.MoveCells);

ws.Columns().AdjustToContents();

workbook.SaveAs("TransposeRanges.xlsx");

And we end up with the following table:
Note: Notice how the Transpose function correctly preserves the formats.

TransposeRanges.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
0