//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); var ws = workbook.Worksheets[0]; ws.Name = "SEQUENCE"; ws.Range["$B$1"].Value = "The SEQUENCE function allows you to generate a list of sequential numbers in an array. Syntax: SEQUENCE(rows,[columns],[start],[step])"; ws.Range["$C$3"].Value = "SEQUENCE(4,5)"; ws.Range["$C$11:$C$12"].Value = new object[,] { { "SEQUENCE(15,,TODAY()) with d-mmm-yy" }, { "Date" } }; ws.Range["$H$11:$H$12"].Value = new object[,] { { "SEQUENCE(10,,100,-10)"}, { "Number"} }; // Apply table style. ITable table = ws.Tables.Add(ws.Range["C12:C27"], true); ITable table1 = ws.Tables.Add(ws.Range["H12:H22"], true); table.ConvertToRange(); table1.ConvertToRange(); ws.Range["$C$4"].Formula2 = "=SEQUENCE(4,5)"; ws.Range["$C$13"].Formula2 = "=SEQUENCE(15,,TODAY())"; ws.Range["$H$13"].Formula2 = "=SEQUENCE(10,,100,-10)"; ws.Range["$C$13:$C$27"].NumberFormat = "d-mmm-yy"; ws.Range["C:C"].EntireColumn.ColumnWidth *= 1.5; // Save to an excel file workbook.Save("SequenceFunction.xlsx");
' Create a new Workbook Dim workbook As New Workbook Dim ws = workbook.Worksheets(0) ws.Name = "SEQUENCE" ws.Range!B1.Value = "The SEQUENCE function allows you to generate a list of sequential numbers in an array. Syntax: SEQUENCE(rows,[columns],[start],[step])" ws.Range!C3.Value = "SEQUENCE(4,5)" ws.Range("$C$11:$C$12").Value = New Object(,) { {"SEQUENCE(15,,TODAY()) with d-mmm-yy"}, {"Date"} } ws.Range("$H$11:$H$12").Value = New Object(,) { {"SEQUENCE(10,,100,-10)"}, {"Number"} } ' Apply table style. Dim table As ITable = ws.Tables.Add(ws.Range("C12:C27"), True) Dim table1 As ITable = ws.Tables.Add(ws.Range("H12:H22"), True) table.ConvertToRange() table1.ConvertToRange() With ws.Range !C4.Formula2 = "=SEQUENCE(4,5)" !C13.Formula2 = "=SEQUENCE(15,,TODAY())" !H13.Formula2 = "=SEQUENCE(10,,100,-10)" End With ws.Range("$C$13:$C$27").NumberFormat = "d-mmm-yy" ws.Range("C:C").EntireColumn.ColumnWidth *= 1.5 ' save to an excel file workbook.Save("SequenceFunction.xlsx")