This project has moved and is read-only. For the latest updates, please go here.

Row Collections

RowCollections.jpg

            var workbook = new XLWorkbook();
            var ws = workbook.Worksheets.Add("Row Collection");

            // All rows in a range
            foreach (var c in ws.Range("B2:C3").Rows())
            {
                c.Style.Fill.BackgroundColor = Color.Red;
            }

            ws.Cell("E5").Value = "Tall 2";

            // Only the used rows in a worksheet
            foreach (var r in ws.Rows())
            {
                r.Height = 30;
            }

            workbook.SaveAs("RowCollections.xlsx");

Last edited Sep 10, 2010 at 10:27 AM by MDeLeon, version 2