Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

how to combine cells in closedXML

var workbook = new XLWorkbook();
var ws = workbook.Worksheets.Add("Merge Cells");

// Merge a row
ws.Cell("B2").Value = "Merged Row(1) of Range (B2:D3)";
ws.Range("B2:D3").Row(1).Merge();

// Merge a column
ws.Cell("F2").Value = "Merged Column(1) of Range (F2:G8)";
ws.Cell("F2").Style.Alignment.WrapText = true;
ws.Range("F2:G8").Column(1).Merge();

// Merge a range
ws.Cell("B4").Value = "Merged Range (B4:D6)";
ws.Cell("B4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell("B4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Range("B4:D6").Merge();

// Unmerging a range...
ws.Cell("B8").Value = "Unmerged";
ws.Range("B8:D8").Merge();
ws.Range("B8:D8").Unmerge();

workbook.SaveAs("MergeCells.xlsx");
Comment

PREVIOUS NEXT
Code Example
Csharp :: stackoverflow array c# 
Csharp :: antlr c# errors 
Csharp :: get all animation clip animator unity 
Csharp :: asp.net mvc hide div from controller 
Csharp :: c# bitwise xor 
Csharp :: Unity Wait Time Fixed 
Csharp :: how to make soft body OBJECT in unity 
Csharp :: ExecuteResultAsync ActionContext statuscode 
Csharp :: c# how to output array 
Csharp :: unity 3d animator live link 
Csharp :: simplified if statement c# 
Csharp :: c# fill values of child from parent 
Csharp :: c# supplier equivalent 
Csharp :: process run teamviewer address parametr c# 
Csharp :: true false when key pressed in c sharp unity 
Csharp :: Initalize C# project in VS Code 
Csharp :: unity AppDomain 
Csharp :: touch screen to world point 
Csharp :: stack iterator c# 
Csharp :: flutter failed asertion 
Csharp :: How to put a (new line) inside a list box 
Csharp :: asp.net core reverse engineer database 
Csharp :: change character velocity unity 
Csharp :: how to make dobuble jump unity 2d 
Csharp :: player movement script unity 
Csharp :: c# make two checkbox uncheckable both 
Csharp :: All and Any linq c# examlpe replace 
Csharp :: c# condition and 
Csharp :: download file c# 
Csharp :: C# Printing Variables and Literals using WriteLine() and Write() 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =