Learn R Programming

XLConnect (version 1.1.0)

clearRangeFromReference-methods: Clearing cell ranges in a workbook

Description

Clears cell ranges specified by area reference in a workbook.

Usage

# S4 method for workbook,character
clearRangeFromReference(object, reference)

Arguments

object

The workbook to use

reference

character specifying an area reference in the form 'SheetX!A7:B19'

Author

Nicola Lambiase
Mirai Solutions GmbH https://mirai-solutions.ch

Details

Clearing a cell range means to clear all the cells associated with that range. This method is very similar to clearRange.

See Also

workbook, clearSheet, clearNamedRegion, clearRange, clearSheet

Examples

Run this code
if (FALSE) {
# mtcars xlsx file from demoFiles subfolder of 
# package XLConnect
demoExcelFile <- system.file("demoFiles/mtcars.xlsx", 
                             package = "XLConnect")

# Load workbook
wb <- loadWorkbook(demoExcelFile)

# Clear ranges A5:D6 and G5:I7 on sheet mtcars
clearRangeFromReference(wb, reference = c("mtcars!A5:D6",
                        "mtcars!G5:I7"))
}

Run the code above in your browser using DataLab