Reputation: 23
How to merge a rang Excel in C# Interop? I want to merge all from A1 to C3. I do
Rang rang = Cells[1,3] as Rang;
But cant work.
A B C
1|----|----|----|
2|----|----|----|
3|----|----|----|
|----|----|----|
Upvotes: 1
Views: 101
Reputation: 825
yourWorksheet.Range[yourWorksheet.Cells[rowBegin,colBegin], yourWorksheet.Cells[yourWorksheet.rowEnd, colEnd]].Merge();
Row and Col start at 1
.
Upvotes: 1