# 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)
wb <- wb_workbook() %>%
wb_add_worksheet() %>%
wb_add_fill(dims = "C3", color = wb_color("yellow")) %>%
wb_set_cell_style_across(style = "C3", cols = "C:D", rows = 3:4)
Run the code above in your browser using DataLab