Pavel

Pavel

  • 1.5k
  • 170
  • 50.2k

How to specify cell range for Excel sheet

Sep 27 2012 6:40 AM
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)