setAutoFilter-methods

0th

Percentile

Setting auto-filters on worksheets

Sets an auto-filter on a specified worksheet.

Keywords
methods, utilities
Usage
# S4 method for workbook,character
setAutoFilter(object,sheet,reference)
# S4 method for workbook,numeric
setAutoFilter(object,sheet,reference)
Arguments
object

The '>workbook to use

sheet

The name or index of the sheet on which to set the auto-filter

reference

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

See Also

'>workbook

Aliases
  • setAutoFilter
  • setAutoFilter-methods
  • setAutoFilter,workbook,character-method
  • setAutoFilter,workbook,numeric-method
Examples
# NOT RUN {
# Load workbook (create if not existing)
wb <- loadWorkbook("autofilter.xlsx", create = TRUE)

# Create a worksheet named 'mtcars'
createSheet(wb, name = "mtcars")

# Create a named region called 'mtcars' on the sheet called 'mtcars'
createName(wb, name = "mtcars", formula = "mtcars!$A$1")

# Write built-in data set 'mtcars' to the above defined named region
# (using header = TRUE)
writeNamedRegion(wb, mtcars, name = "mtcars")

# Set an auto-filter for the named region written above
setAutoFilter(wb, sheet = "mtcars", reference = aref("A1", dim(mtcars)))

# Save workbook (this actually writes the file to disk)
saveWorkbook(wb)
# }
Documentation reproduced from package XLConnect, version 0.2-14, License: GPL-3

Community examples

Looks like there are no examples yet.