mergeCells-methods: Merging cells

mergeCells-methodsR Documentation

Merging cells

Description

Merges cells in a worksheet.

Usage

## S4 method for signature 'workbook,character'
mergeCells(object,sheet,reference)
## S4 method for signature 'workbook,numeric'
mergeCells(object,sheet,reference)

Arguments

object

The workbook to use

sheet

The name or index of the sheet on which to merge cells

reference

A cell range specification (character) in the form 'A1:B8'

Author(s)

Martin Studer
Mirai Solutions GmbH https://mirai-solutions.ch

See Also

workbook, unmergeCells, idx2cref

Examples

## Not run: 
# Load workbook (create if not existing)
wb <- loadWorkbook("mergeCells.xlsx", create = TRUE)

# Create a worksheet called 'merge'
createSheet(wb, name = "merge")

# Merge the cells A1:B8 on the worksheet created above
mergeCells(wb, sheet = "merge", reference = "A1:B8")

# Save workbook
saveWorkbook(wb)

# clean up 
file.remove("mergeCells.xlsx")

## End(Not run)

XLConnect documentation built on Feb. 16, 2023, 5:53 p.m.