This project has moved. For the latest updates, please go here.

Column Collections

ColumnCollections.jpg

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

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

            ws.Cell("E1").Value = "Wide 2";

            // Only the used columns in a worksheet
            foreach (var c in ws.Columns())
            {
                c.Width = 20;
            }

            workbook.SaveAs("Column Collections");

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