Clearing cell ranges in a workbook

Share:

Description

Clears cell ranges specified by area reference in a workbook.

Usage

1
2
  ## S4 method for signature 'workbook,character'
clearRangeFromReference(object, reference)

Arguments

object

The workbook to use

reference

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

Details

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

Author(s)

Nicola Lambiase
Mirai Solutions GmbH http://www.mirai-solutions.com

See Also

workbook, clearSheet, clearNamedRegion, clearRange, clearSheet

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 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"))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.