getCellFormula-methods

0th

Percentile

Retrieving formula definitions from cells

Retrieves a cell formula from a '>workbook.

Keywords
methods, utilities
Usage
# S4 method for workbook,character
getCellFormula(object,sheet,row,col)
# S4 method for workbook,numeric
getCellFormula(object,sheet,row,col)
Arguments
object

The '>workbook to use

sheet

The name or index of the worksheet containing the cell

row

The one-based row index of the cell to query

col

The one-based column index of the cell to query

Details

Retrieves the formula of the specified cell as a character, without the initial = character displayed in Excel. Raises an error if the specified cell is not a formula cell.

See Also

'>workbook, setCellFormula

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

createSheet(wb, "Formula")

# Assign a formula to A1
setCellFormula(wb, "Formula", 1, 1, "SUM($B$1:$B$29)")

# Returns the formula for Sheet1!A1
getCellFormula(wb, "Formula", 1, 1)
# The same with a numeric sheet index
getCellFormula(wb, 1, 1, 1)
# }
Documentation reproduced from package XLConnect, version 0.2-14, License: GPL-3

Community examples

Looks like there are no examples yet.