Converts a vertical range of cells to a horizontal range, or vice versa.
Name | Type | Description |
arg1 | any | Is a range of cells on a worksheet or an array of values that you want to transpose. |
builder.CreateFile("xlsx"); var oWorksheet = Api.GetActiveSheet(); var oFunction = Api.GetWorksheetFunction(); oWorksheet.GetRange("A1").SetValue("Ann"); oWorksheet.GetRange("A2").SetValue("Bob"); oWorksheet.GetRange("B1").SetValue("Apples"); oWorksheet.GetRange("B2").SetValue("Oranges"); var oRange = oWorksheet.GetRange("A1:B2"); oWorksheet.GetRange("A4:B5").SetValue(oFunction.TRANSPOSE(oRange)); builder.SaveFile("xlsx", "TRANSPOSE.xlsx"); builder.CloseFile();