//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); // VSTACK Function Example IWorksheet sheetOfVSTACK = workbook.ActiveSheet; sheetOfVSTACK.Name = "VSTACK"; sheetOfVSTACK.Range["A1:G3"].Value = new object[,] { { "Data", null, null, null, null, null, null }, { "A", "B", "C", null, "AA", "BB", "CC" }, { "D", "E", "F", null, "DD", "EE", "FF" } }; sheetOfVSTACK.Range["A1"].Font.Bold = true; sheetOfVSTACK.Range["A4"].Value = "Formula"; sheetOfVSTACK.Range["A4"].Font.Bold = true; sheetOfVSTACK.Range["A5"].Formula = "=FORMULATEXT(A7)"; sheetOfVSTACK.Range["A6"].Value = "Result"; sheetOfVSTACK.Range["A6"].Font.Bold = true; sheetOfVSTACK.Range["A7"].Formula2 = "=VSTACK(A2:C3,E2:G3)"; // HSTACK Function Example IWorksheet sheetOfHSTACK = workbook.Worksheets.Add(); sheetOfHSTACK.Name = "HSTACK"; sheetOfHSTACK.Range["A1:G3"].Value = new object[,] { { "Data", null, null, null, null, null, null }, { "A", "B", "C", null, "AA", "BB", "CC" }, { "D", "E", "F", null, "DD", "EE", "FF" } }; sheetOfHSTACK.Range["A1"].Font.Bold = true; sheetOfHSTACK.Range["A4"].Value = "Formula"; sheetOfHSTACK.Range["A4"].Font.Bold = true; sheetOfHSTACK.Range["A5"].Formula = "=FORMULATEXT(A7)"; sheetOfHSTACK.Range["A6"].Value = "Result"; sheetOfHSTACK.Range["A6"].Font.Bold = true; sheetOfHSTACK.Range["A7"].Formula2 = "=HSTACK(A2:C3,E2:G3)"; // TOROW Function Example IWorksheet sheetOfTOROW = workbook.Worksheets.Add(); sheetOfTOROW.Name = "TOROW"; sheetOfTOROW.Range["A1:D4"].Value = new object[,] { { "Data", null, null, null }, { "Ben", "Peter", "Mary", "Sam" }, { "John", "Hillary", "Jenny", "James" }, { "Agnes", "Harry", "Felicity", "Joe" } }; sheetOfTOROW.Range["A1"].Font.Bold = true; sheetOfTOROW.Range["A5"].Value = "Formula"; sheetOfTOROW.Range["A5"].Font.Bold = true; sheetOfTOROW.Range["A6"].Formula = "=FORMULATEXT(A8)"; sheetOfTOROW.Range["A7"].Value = "Result"; sheetOfTOROW.Range["A7"].Font.Bold = true; sheetOfTOROW.Range["A8"].Formula2 = "=TOROW(A2:D4)"; // TOCOL Function Exmaple IWorksheet sheetOfTOCOL = workbook.Worksheets.Add(); sheetOfTOCOL.Name = "TOCOL"; sheetOfTOCOL.Range["A1:D4"].Value = new object[,] { { "Data", null, null, null }, { "Ben", "Peter", "Mary", "Sam" }, { "John", "Hillary", "Jenny", "James" }, { "Agnes", "Harry", "Felicity", "Joe" } }; sheetOfTOCOL.Range["A1"].Font.Bold = true; sheetOfTOCOL.Range["A5"].Value = "Formula"; sheetOfTOCOL.Range["A5"].Font.Bold = true; sheetOfTOCOL.Range["A6"].Formula = "=FORMULATEXT(A8)"; sheetOfTOCOL.Range["A7"].Value = "Result"; sheetOfTOCOL.Range["A7"].Font.Bold = true; sheetOfTOCOL.Range["A8"].Formula2 = "=TOCOL(A2:D4)"; // WRAPROWS Function Example IWorksheet sheetOfWRAPROWS = workbook.Worksheets.Add(); sheetOfWRAPROWS.Name = "WRAPROWS"; sheetOfWRAPROWS.Range["A1:G2"].Value = new object[,] { { "Data", null, null, null, null, null, null }, { "A", "B", "C", "D", "E", "F", "G" } }; sheetOfWRAPROWS.Range["A1"].Font.Bold = true; sheetOfWRAPROWS.Range["A4"].Value = "Formula"; sheetOfWRAPROWS.Range["A4"].Font.Bold = true; sheetOfWRAPROWS.Range["B4"].Formula = "=FORMULATEXT(B5)"; sheetOfWRAPROWS.Range["A5"].Value = "Result"; sheetOfWRAPROWS.Range["A5"].Font.Bold = true; sheetOfWRAPROWS.Range["B5"].Formula2 = "=WRAPROWS(A2:G2,3)"; sheetOfWRAPROWS.Range["A9"].Value = "Formula"; sheetOfWRAPROWS.Range["A9"].Font.Bold = true; sheetOfWRAPROWS.Range["B9"].Formula = "=FORMULATEXT(B10)"; sheetOfWRAPROWS.Range["A10"].Value = "Result"; sheetOfWRAPROWS.Range["A10"].Font.Bold = true; sheetOfWRAPROWS.Range["B10"].Formula2 = "=WRAPROWS(A2:G2,3,\"x\")"; // WRAPCOLS IWorksheet sheetOfWRAPCOLS = workbook.Worksheets.Add(); sheetOfWRAPCOLS.Name = "WRAPCOLS"; sheetOfWRAPCOLS.Range["A1:G2"].Value = new object[,] { { "Data", null, null, null, null, null, null }, { "A", "B", "C", "D", "E", "F", "G" } }; sheetOfWRAPCOLS.Range["A1"].Font.Bold = true; sheetOfWRAPCOLS.Range["A4"].Value = "Formula"; sheetOfWRAPCOLS.Range["A4"].Font.Bold = true; sheetOfWRAPCOLS.Range["B4"].Formula = "=FORMULATEXT(B5)"; sheetOfWRAPCOLS.Range["A5"].Value = "Result"; sheetOfWRAPCOLS.Range["A5"].Font.Bold = true; sheetOfWRAPCOLS.Range["B5"].Formula2 = "=WRAPCOLS(A2:G2,3)"; sheetOfWRAPCOLS.Range["A9"].Value = "Formula"; sheetOfWRAPCOLS.Range["A9"].Font.Bold = true; sheetOfWRAPCOLS.Range["B9"].Formula = "=FORMULATEXT(B10)"; sheetOfWRAPCOLS.Range["A10"].Value = "Result"; sheetOfWRAPCOLS.Range["A10"].Font.Bold = true; sheetOfWRAPCOLS.Range["B10"].Formula2 = "=WRAPCOLS(A2:G2,3,\"x\")"; // TAKE Function Example IWorksheet sheetOfTAKE = workbook.Worksheets.Add(); sheetOfTAKE.Name = "TAKE"; sheetOfTAKE.Range["A1:C4"].Value = new object[,] { { "Data", null, null }, { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } }; sheetOfTAKE.Range["A1"].Font.Bold = true; sheetOfTAKE.Range["A6"].Value = "Formula"; sheetOfTAKE.Range["A6"].Font.Bold = true; sheetOfTAKE.Range["B6"].Formula = "=FORMULATEXT(B7)"; sheetOfTAKE.Range["A7"].Value = "Result"; sheetOfTAKE.Range["A7"].Font.Bold = true; sheetOfTAKE.Range["B7"].Formula2 = "=TAKE(A2:C4,2)"; sheetOfTAKE.Range["A10"].Value = "Formula"; sheetOfTAKE.Range["A10"].Font.Bold = true; sheetOfTAKE.Range["B10"].Formula = "=FORMULATEXT(B11)"; sheetOfTAKE.Range["A11"].Value = "Result"; sheetOfTAKE.Range["A11"].Font.Bold = true; sheetOfTAKE.Range["B11"].Formula2 = "=TAKE(A2:C4,,2)"; sheetOfTAKE.Range["A15"].Value = "Formula"; sheetOfTAKE.Range["A15"].Font.Bold = true; sheetOfTAKE.Range["B15"].Formula = "=FORMULATEXT(B16)"; sheetOfTAKE.Range["A16"].Value = "Result"; sheetOfTAKE.Range["A16"].Font.Bold = true; sheetOfTAKE.Range["B16"].Formula2 = "=TAKE(A2:C4,-2)"; sheetOfTAKE.Range["A19"].Value = "Formula"; sheetOfTAKE.Range["A19"].Font.Bold = true; sheetOfTAKE.Range["B19"].Formula = "=FORMULATEXT(B20)"; sheetOfTAKE.Range["A20"].Value = "Result"; sheetOfTAKE.Range["A20"].Font.Bold = true; sheetOfTAKE.Range["B20"].Formula2 = "=TAKE(A2:C4,2,2)"; // DROP Function Example IWorksheet sheetOfDROP = workbook.Worksheets.Add(); sheetOfDROP.Name = "DROP"; sheetOfDROP.Range["A1:C4"].Value = new object[,] { { "Data", null, null }, { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } }; sheetOfDROP.Range["A1"].Font.Bold = true; sheetOfDROP.Range["A6"].Value = "Formula"; sheetOfDROP.Range["A6"].Font.Bold = true; sheetOfDROP.Range["B6"].Formula = "=FORMULATEXT(B7)"; sheetOfDROP.Range["A7"].Value = "Result"; sheetOfDROP.Range["A7"].Font.Bold = true; sheetOfDROP.Range["B7"].Formula2 = "=DROP(A2:C4,2)"; sheetOfDROP.Range["A9"].Value = "Formula"; sheetOfDROP.Range["A9"].Font.Bold = true; sheetOfDROP.Range["B9"].Formula = "=FORMULATEXT(B10)"; sheetOfDROP.Range["A10"].Value = "Result"; sheetOfDROP.Range["A10"].Font.Bold = true; sheetOfDROP.Range["B10"].Formula2 = "=DROP(A2:C4,,2)"; sheetOfDROP.Range["A14"].Value = "Formula"; sheetOfDROP.Range["A14"].Font.Bold = true; sheetOfDROP.Range["B14"].Formula = "=FORMULATEXT(B15)"; sheetOfDROP.Range["A15"].Value = "Result"; sheetOfDROP.Range["A15"].Font.Bold = true; sheetOfDROP.Range["B15"].Formula2 = "=DROP(A2:C4,-2)"; sheetOfDROP.Range["A17"].Value = "Formula"; sheetOfDROP.Range["A17"].Font.Bold = true; sheetOfDROP.Range["B17"].Formula = "=FORMULATEXT(B18)"; sheetOfDROP.Range["A18"].Value = "Result"; sheetOfDROP.Range["A18"].Font.Bold = true; sheetOfDROP.Range["B18"].Formula2 = "=DROP(A2:C4,2,2)"; // CHOOSEROWS Function Example IWorksheet sheetOfCHOOSEROWS = workbook.Worksheets.Add(); sheetOfCHOOSEROWS.Name = "CHOOSEROWS"; sheetOfCHOOSEROWS.Range["A1:B7"].Value = new object[,] { { "Data", null }, { 1, 2 }, { 3, 4 }, { 5, 6 }, { 7, 8 }, { 9, 10 }, { 11, 12 } }; sheetOfCHOOSEROWS.Range["A1"].Font.Bold = true; sheetOfCHOOSEROWS.Range["A9"].Value = "Formula"; sheetOfCHOOSEROWS.Range["A9"].Font.Bold = true; sheetOfCHOOSEROWS.Range["B9"].Formula = "=FORMULATEXT(B10)"; sheetOfCHOOSEROWS.Range["A10"].Value = "Result"; sheetOfCHOOSEROWS.Range["A10"].Font.Bold = true; sheetOfCHOOSEROWS.Range["B10"].Formula2 = "=CHOOSEROWS(A2:B7,1,3,5,1)"; sheetOfCHOOSEROWS.Range["A15"].Value = "Formula"; sheetOfCHOOSEROWS.Range["A15"].Font.Bold = true; sheetOfCHOOSEROWS.Range["B15"].Formula = "=FORMULATEXT(B16)"; sheetOfCHOOSEROWS.Range["A16"].Value = "Result"; sheetOfCHOOSEROWS.Range["A16"].Font.Bold = true; sheetOfCHOOSEROWS.Range["B16"].Formula2 = "=CHOOSEROWS(A2:B7,-1,-2)"; // CHOOSECOLS Function Example IWorksheet sheetOfCHOOSECOLS = workbook.Worksheets.Add(); sheetOfCHOOSECOLS.Name = "CHOOSECOLS"; sheetOfCHOOSECOLS.Range["A1:E6"].Value = new object[,] { { "Data", null, null, null, null }, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}, {16, 17, 18, 19, 20}, {21, 22, 23, 24, 25} }; sheetOfCHOOSECOLS.Range["A1"].Font.Bold = true; sheetOfCHOOSECOLS.Range["A8"].Value = "Formula"; sheetOfCHOOSECOLS.Range["A8"].Font.Bold = true; sheetOfCHOOSECOLS.Range["B8"].Formula = "=FORMULATEXT(B9)"; sheetOfCHOOSECOLS.Range["A9"].Value = "Result"; sheetOfCHOOSECOLS.Range["A9"].Font.Bold = true; sheetOfCHOOSECOLS.Range["B9"].Formula2 = "=CHOOSECOLS(A2:E6,1,3,5,1)"; sheetOfCHOOSECOLS.Range["A15"].Value = "Formula"; sheetOfCHOOSECOLS.Range["A15"].Font.Bold = true; sheetOfCHOOSECOLS.Range["B15"].Formula = "=FORMULATEXT(B16)"; sheetOfCHOOSECOLS.Range["A16"].Value = "Result"; sheetOfCHOOSECOLS.Range["A16"].Font.Bold = true; sheetOfCHOOSECOLS.Range["B16"].Formula2 = "=CHOOSECOLS(A2:E6,-1,-2)"; // EXPAND Function Exmaple IWorksheet sheetOfEXPAND = workbook.Worksheets.Add(); sheetOfEXPAND.Name = "EXPAND"; sheetOfEXPAND.Range["A1:C3"].Value = new object[,] { { "Data", null }, { 1, 2 }, { 3, 4 } }; sheetOfEXPAND.Range["A1"].Font.Bold = true; sheetOfEXPAND.Range["A5"].Value = "Formula"; sheetOfEXPAND.Range["A5"].Font.Bold = true; sheetOfEXPAND.Range["B5"].Formula = "=FORMULATEXT(B6)"; sheetOfEXPAND.Range["A6"].Value = "Result"; sheetOfEXPAND.Range["A6"].Font.Bold = true; sheetOfEXPAND.Range["B6"].Formula2 = "=EXPAND(A2:B3,3,3)"; sheetOfEXPAND.Range["A10"].Value = "Formula"; sheetOfEXPAND.Range["A10"].Font.Bold = true; sheetOfEXPAND.Range["B10"].Formula = "=FORMULATEXT(B11)"; sheetOfEXPAND.Range["A11"].Value = "Result"; sheetOfEXPAND.Range["A11"].Font.Bold = true; sheetOfEXPAND.Range["B11"].Formula2 = "=EXPAND(A2:B3,3,3,\"-\")"; // Save to an excel file workbook.Save("NewArrayManipulationFunctions.xlsx");
' Create a new Workbook Dim workbook As New Workbook ' VSTACK Function Example Dim sheetOfVSTACK As IWorksheet = workbook.ActiveSheet sheetOfVSTACK.Name = "VSTACK" sheetOfVSTACK.Range("A1:G3").Value = New Object(,) { {"Data", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, {"A", "B", "C", Nothing, "AA", "BB", "CC"}, {"D", "E", "F", Nothing, "DD", "EE", "FF"} } sheetOfVSTACK.Range("A1").Font.Bold = True sheetOfVSTACK.Range("A4").Value = "Formula" sheetOfVSTACK.Range("A4").Font.Bold = True sheetOfVSTACK.Range("A5").Formula = "=FORMULATEXT(A7)" sheetOfVSTACK.Range("A6").Value = "Result" sheetOfVSTACK.Range("A6").Font.Bold = True sheetOfVSTACK.Range("A7").Formula2 = "=VSTACK(A2:C3,E2:G3)" ' HSTACK Function Example Dim sheetOfHSTACK As IWorksheet = workbook.Worksheets.Add() sheetOfHSTACK.Name = "HSTACK" sheetOfHSTACK.Range("A1:G3").Value = New Object(,) { {"Data", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, {"A", "B", "C", Nothing, "AA", "BB", "CC"}, {"D", "E", "F", Nothing, "DD", "EE", "FF"} } sheetOfHSTACK.Range("A1").Font.Bold = True sheetOfHSTACK.Range("A4").Value = "Formula" sheetOfHSTACK.Range("A4").Font.Bold = True sheetOfHSTACK.Range("A5").Formula = "=FORMULATEXT(A7)" sheetOfHSTACK.Range("A6").Value = "Result" sheetOfHSTACK.Range("A6").Font.Bold = True sheetOfHSTACK.Range("A7").Formula2 = "=HSTACK(A2:C3,E2:G3)" ' TOROW Function Example Dim sheetOfTOROW As IWorksheet = workbook.Worksheets.Add() sheetOfTOROW.Name = "TOROW" sheetOfTOROW.Range("A1:D4").Value = New Object(,) { {"Data", Nothing, Nothing, Nothing}, {"Ben", "Peter", "Mary", "Sam"}, {"John", "Hillary", "Jenny", "James"}, {"Agnes", "Harry", "Felicity", "Joe"} } sheetOfTOROW.Range("A1").Font.Bold = True sheetOfTOROW.Range("A5").Value = "Formula" sheetOfTOROW.Range("A5").Font.Bold = True sheetOfTOROW.Range("A6").Formula = "=FORMULATEXT(A8)" sheetOfTOROW.Range("A7").Value = "Result" sheetOfTOROW.Range("A7").Font.Bold = True sheetOfTOROW.Range("A8").Formula2 = "=TOROW(A2:D4)" ' TOCOL Function Exmaple Dim sheetOfTOCOL As IWorksheet = workbook.Worksheets.Add() sheetOfTOCOL.Name = "TOCOL" sheetOfTOCOL.Range("A1:D4").Value = New Object(,) { {"Data", Nothing, Nothing, Nothing}, {"Ben", "Peter", "Mary", "Sam"}, {"John", "Hillary", "Jenny", "James"}, {"Agnes", "Harry", "Felicity", "Joe"} } sheetOfTOCOL.Range("A1").Font.Bold = True sheetOfTOCOL.Range("A5").Value = "Formula" sheetOfTOCOL.Range("A5").Font.Bold = True sheetOfTOCOL.Range("A6").Formula = "=FORMULATEXT(A8)" sheetOfTOCOL.Range("A7").Value = "Result" sheetOfTOCOL.Range("A7").Font.Bold = True sheetOfTOCOL.Range("A8").Formula2 = "=TOCOL(A2:D4)" ' WRAPROWS Function Example Dim sheetOfWRAPROWS As IWorksheet = workbook.Worksheets.Add() sheetOfWRAPROWS.Name = "WRAPROWS" sheetOfWRAPROWS.Range("A1:G2").Value = New Object(,) { {"Data", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, {"A", "B", "C", "D", "E", "F", "G"} } sheetOfWRAPROWS.Range("A1").Font.Bold = True sheetOfWRAPROWS.Range("A4").Value = "Formula" sheetOfWRAPROWS.Range("A4").Font.Bold = True sheetOfWRAPROWS.Range("B4").Formula = "=FORMULATEXT(B5)" sheetOfWRAPROWS.Range("A5").Value = "Result" sheetOfWRAPROWS.Range("A5").Font.Bold = True sheetOfWRAPROWS.Range("B5").Formula2 = "=WRAPROWS(A2:G2,3)" sheetOfWRAPROWS.Range("A9").Value = "Formula" sheetOfWRAPROWS.Range("A9").Font.Bold = True sheetOfWRAPROWS.Range("B9").Formula = "=FORMULATEXT(B10)" sheetOfWRAPROWS.Range("A10").Value = "Result" sheetOfWRAPROWS.Range("A10").Font.Bold = True sheetOfWRAPROWS.Range("B10").Formula2 = "=WRAPROWS(A2:G2,3,""x"")" ' WRAPCOLS Dim sheetOfWRAPCOLS As IWorksheet = workbook.Worksheets.Add() sheetOfWRAPCOLS.Name = "WRAPCOLS" sheetOfWRAPCOLS.Range("A1:G2").Value = New Object(,) { {"Data", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, {"A", "B", "C", "D", "E", "F", "G"} } sheetOfWRAPCOLS.Range("A1").Font.Bold = True sheetOfWRAPCOLS.Range("A4").Value = "Formula" sheetOfWRAPCOLS.Range("A4").Font.Bold = True sheetOfWRAPCOLS.Range("B4").Formula = "=FORMULATEXT(B5)" sheetOfWRAPCOLS.Range("A5").Value = "Result" sheetOfWRAPCOLS.Range("A5").Font.Bold = True sheetOfWRAPCOLS.Range("B5").Formula2 = "=WRAPCOLS(A2:G2,3)" sheetOfWRAPCOLS.Range("A9").Value = "Formula" sheetOfWRAPCOLS.Range("A9").Font.Bold = True sheetOfWRAPCOLS.Range("B9").Formula = "=FORMULATEXT(B10)" sheetOfWRAPCOLS.Range("A10").Value = "Result" sheetOfWRAPCOLS.Range("A10").Font.Bold = True sheetOfWRAPCOLS.Range("B10").Formula2 = "=WRAPCOLS(A2:G2,3,""x"")" ' TAKE Function Example Dim sheetOfTAKE As IWorksheet = workbook.Worksheets.Add() sheetOfTAKE.Name = "TAKE" sheetOfTAKE.Range("A1:C4").Value = New Object(,) { {"Data", Nothing, Nothing}, {1, 2, 3}, {4, 5, 6}, {7, 8, 9} } sheetOfTAKE.Range("A1").Font.Bold = True sheetOfTAKE.Range("A6").Value = "Formula" sheetOfTAKE.Range("A6").Font.Bold = True sheetOfTAKE.Range("B6").Formula = "=FORMULATEXT(B7)" sheetOfTAKE.Range("A7").Value = "Result" sheetOfTAKE.Range("A7").Font.Bold = True sheetOfTAKE.Range("B7").Formula2 = "=TAKE(A2:C4,2)" sheetOfTAKE.Range("A10").Value = "Formula" sheetOfTAKE.Range("A10").Font.Bold = True sheetOfTAKE.Range("B10").Formula = "=FORMULATEXT(B11)" sheetOfTAKE.Range("A11").Value = "Result" sheetOfTAKE.Range("A11").Font.Bold = True sheetOfTAKE.Range("B11").Formula2 = "=TAKE(A2:C4,,2)" sheetOfTAKE.Range("A15").Value = "Formula" sheetOfTAKE.Range("A15").Font.Bold = True sheetOfTAKE.Range("B15").Formula = "=FORMULATEXT(B16)" sheetOfTAKE.Range("A16").Value = "Result" sheetOfTAKE.Range("A16").Font.Bold = True sheetOfTAKE.Range("B16").Formula2 = "=TAKE(A2:C4,-2)" sheetOfTAKE.Range("A19").Value = "Formula" sheetOfTAKE.Range("A19").Font.Bold = True sheetOfTAKE.Range("B19").Formula = "=FORMULATEXT(B20)" sheetOfTAKE.Range("A20").Value = "Result" sheetOfTAKE.Range("A20").Font.Bold = True sheetOfTAKE.Range("B20").Formula2 = "=TAKE(A2:C4,2,2)" ' DROP Function Example Dim sheetOfDROP As IWorksheet = workbook.Worksheets.Add() sheetOfDROP.Name = "DROP" sheetOfDROP.Range("A1:C4").Value = New Object(,) { {"Data", Nothing, Nothing}, {1, 2, 3}, {4, 5, 6}, {7, 8, 9} } sheetOfDROP.Range("A1").Font.Bold = True sheetOfDROP.Range("A6").Value = "Formula" sheetOfDROP.Range("A6").Font.Bold = True sheetOfDROP.Range("B6").Formula = "=FORMULATEXT(B7)" sheetOfDROP.Range("A7").Value = "Result" sheetOfDROP.Range("A7").Font.Bold = True sheetOfDROP.Range("B7").Formula2 = "=DROP(A2:C4,2)" sheetOfDROP.Range("A9").Value = "Formula" sheetOfDROP.Range("A9").Font.Bold = True sheetOfDROP.Range("B9").Formula = "=FORMULATEXT(B10)" sheetOfDROP.Range("A10").Value = "Result" sheetOfDROP.Range("A10").Font.Bold = True sheetOfDROP.Range("B10").Formula2 = "=DROP(A2:C4,,2)" sheetOfDROP.Range("A14").Value = "Formula" sheetOfDROP.Range("A14").Font.Bold = True sheetOfDROP.Range("B14").Formula = "=FORMULATEXT(B15)" sheetOfDROP.Range("A15").Value = "Result" sheetOfDROP.Range("A15").Font.Bold = True sheetOfDROP.Range("B15").Formula2 = "=DROP(A2:C4,-2)" sheetOfDROP.Range("A17").Value = "Formula" sheetOfDROP.Range("A17").Font.Bold = True sheetOfDROP.Range("B17").Formula = "=FORMULATEXT(B18)" sheetOfDROP.Range("A18").Value = "Result" sheetOfDROP.Range("A18").Font.Bold = True sheetOfDROP.Range("B18").Formula2 = "=DROP(A2:C4,2,2)" ' CHOOSEROWS Function Example Dim sheetOfCHOOSEROWS As IWorksheet = workbook.Worksheets.Add() sheetOfCHOOSEROWS.Name = "CHOOSEROWS" sheetOfCHOOSEROWS.Range("A1:B7").Value = New Object(,) { {"Data", Nothing}, {1, 2}, {3, 4}, {5, 6}, {7, 8}, {9, 10}, {11, 12} } sheetOfCHOOSEROWS.Range("A1").Font.Bold = True sheetOfCHOOSEROWS.Range("A9").Value = "Formula" sheetOfCHOOSEROWS.Range("A9").Font.Bold = True sheetOfCHOOSEROWS.Range("B9").Formula = "=FORMULATEXT(B10)" sheetOfCHOOSEROWS.Range("A10").Value = "Result" sheetOfCHOOSEROWS.Range("A10").Font.Bold = True sheetOfCHOOSEROWS.Range("B10").Formula2 = "=CHOOSEROWS(A2:B7,1,3,5,1)" sheetOfCHOOSEROWS.Range("A15").Value = "Formula" sheetOfCHOOSEROWS.Range("A15").Font.Bold = True sheetOfCHOOSEROWS.Range("B15").Formula = "=FORMULATEXT(B16)" sheetOfCHOOSEROWS.Range("A16").Value = "Result" sheetOfCHOOSEROWS.Range("A16").Font.Bold = True sheetOfCHOOSEROWS.Range("B16").Formula2 = "=CHOOSEROWS(A2:B7,-1,-2)" ' CHOOSECOLS Function Example Dim sheetOfCHOOSECOLS As IWorksheet = workbook.Worksheets.Add() sheetOfCHOOSECOLS.Name = "CHOOSECOLS" sheetOfCHOOSECOLS.Range("A1:E6").Value = New Object(,) { {"Data", Nothing, Nothing, Nothing, Nothing}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}, {16, 17, 18, 19, 20}, {21, 22, 23, 24, 25} } sheetOfCHOOSECOLS.Range("A1").Font.Bold = True sheetOfCHOOSECOLS.Range("A8").Value = "Formula" sheetOfCHOOSECOLS.Range("A8").Font.Bold = True sheetOfCHOOSECOLS.Range("B8").Formula = "=FORMULATEXT(B9)" sheetOfCHOOSECOLS.Range("A9").Value = "Result" sheetOfCHOOSECOLS.Range("A9").Font.Bold = True sheetOfCHOOSECOLS.Range("B9").Formula2 = "=CHOOSECOLS(A2:E6,1,3,5,1)" sheetOfCHOOSECOLS.Range("A15").Value = "Formula" sheetOfCHOOSECOLS.Range("A15").Font.Bold = True sheetOfCHOOSECOLS.Range("B15").Formula = "=FORMULATEXT(B16)" sheetOfCHOOSECOLS.Range("A16").Value = "Result" sheetOfCHOOSECOLS.Range("A16").Font.Bold = True sheetOfCHOOSECOLS.Range("B16").Formula2 = "=CHOOSECOLS(A2:E6,-1,-2)" ' EXPAND Function Exmaple Dim sheetOfEXPAND As IWorksheet = workbook.Worksheets.Add() sheetOfEXPAND.Name = "EXPAND" sheetOfEXPAND.Range("A1:C3").Value = New Object(,) { {"Data", Nothing}, {1, 2}, {3, 4} } sheetOfEXPAND.Range("A1").Font.Bold = True sheetOfEXPAND.Range("A5").Value = "Formula" sheetOfEXPAND.Range("A5").Font.Bold = True sheetOfEXPAND.Range("B5").Formula = "=FORMULATEXT(B6)" sheetOfEXPAND.Range("A6").Value = "Result" sheetOfEXPAND.Range("A6").Font.Bold = True sheetOfEXPAND.Range("B6").Formula2 = "=EXPAND(A2:B3,3,3)" sheetOfEXPAND.Range("A10").Value = "Formula" sheetOfEXPAND.Range("A10").Font.Bold = True sheetOfEXPAND.Range("B10").Formula = "=FORMULATEXT(B11)" sheetOfEXPAND.Range("A11").Value = "Result" sheetOfEXPAND.Range("A11").Font.Bold = True sheetOfEXPAND.Range("B11").Formula2 = "=EXPAND(A2:B3,3,3,""-"")" ' save to an excel file workbook.Save("NewArrayManipulationFunctions.xlsx")