Learn R Programming

openxlsx (version 4.2.6.1)

setRowHeights: Set worksheet row heights

Description

Set worksheet row heights

Usage

setRowHeights(wb, sheet, rows, heights)

Arguments

wb

A workbook object

sheet

A name or index of a worksheet

rows

Indices of rows to set height

heights

Heights to set rows to specified in Excel column height units.

Author

Alexander Walker

See Also

removeRowHeights()

Examples

Run this code
## Create a new workbook
wb <- createWorkbook()

## Add a worksheet
addWorksheet(wb, "Sheet 1")

## set row heights
setRowHeights(wb, 1, rows = c(1, 4, 22, 2, 19), heights = c(24, 28, 32, 42, 33))

## overwrite row 1 height
setRowHeights(wb, 1, rows = 1, heights = 40)

## Save workbook
if (FALSE) {
saveWorkbook(wb, "setRowHeightsExample.xlsx", overwrite = TRUE)
}

Run the code above in your browser using DataLab