freezePane: Freeze a worksheet pane

Description Usage Arguments Author(s) Examples

Description

Freeze a worksheet pane

Usage

1
2
freezePane(wb, sheet, firstActiveRow = NULL, firstActiveCol = NULL,
  firstRow = FALSE, firstCol = FALSE)

Arguments

wb

A workbook object

sheet

A name or index of a worksheet

firstActiveRow

Top row of active region

firstActiveCol

Furthest left column of active region

firstRow

If TRUE, freezes the first row (equivalent to firstActiveRow = 2)

firstCol

If TRUE, freezes the first column (equivalent to firstActiveCol = 2)

Author(s)

Alexander Walker

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Create a new workbook
wb <- createWorkbook("Kenshin")

## Add some worksheets
addWorksheet(wb, "Sheet 1")
addWorksheet(wb, "Sheet 2")
addWorksheet(wb, "Sheet 3")
addWorksheet(wb, "Sheet 4")

## Freeze Panes
freezePane(wb, "Sheet 1" ,  firstActiveRow = 5,  firstActiveCol = 3)
freezePane(wb, "Sheet 2", firstCol = TRUE)  ## shortcut to firstActiveCol = 2
freezePane(wb, 3, firstRow = TRUE)  ## shortcut to firstActiveRow = 2
freezePane(wb, 4, firstActiveRow = 1, firstActiveCol = "D")
 
## Save workbook
saveWorkbook(wb, "freezePaneExample.xlsx", overwrite = TRUE)

awalker89/openxlsx documentation built on May 11, 2019, 4:09 p.m.