1
Answer

How to specify cell range for Excel sheet

Pavel

Pavel

12y
2.2k
1
Hello,

How to specify cell range in order to change cell properties without loop.
For columns it works:

myExcelWorksheet.Columns["A:G"].ColumnWidth = 3;
myExcelWorksheet.Columns["H:V"].ColumnWidth = 5;


But when I try to use the same technique for cells it doesn't work. The following command generates run-time error.

myExcelWorksheet.Cells["I2:I5"].Font.Color = Color.FromArgb(0xFF, 0x00, 0xFF);

Thanks in advance.

Pavel.

Answers (1)