Learn R Programming

openxlsx2 (version 0.6.1)

cell_style: get and set cell style

Description

get and set cell style

Usage

wb_get_cell_style(wb, sheet = current_sheet(), dims)

wb_set_cell_style(wb, sheet = current_sheet(), dims, style)

Value

wb_get_cell_style returns the style id as character

wb_set_cell_style returns the workbook invisible

Arguments

wb

wb

sheet

sheet

dims

dims

style

style

Examples

Run this code
# set a style in b1
wb <- wb_workbook()$add_worksheet()$
  add_numfmt(dims = "B1", numfmt = "#,0")

# get style from b1 to assign it to a1
numfmt <- wb$get_cell_style(dims = "B1")

# assign style to a1
wb$set_cell_style(dims = "A1", style = numfmt)

Run the code above in your browser using DataLab