Description Usage Arguments Author(s) See Also Examples
Replace an existing cell style
Replace a style object
1 | replaceStyle(wb, index, newStyle)
|
wb |
A workbook object |
index |
Index of style object to replace |
newStyle |
A style to replace the existing style as position index |
Alexander Walker
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## load a workbook
wb <- loadWorkbook(file = system.file("loadExample.xlsx", package = "openxlsx"))
## create a new style and replace style 2
newStyle <- createStyle(fgFill = "#00FF00")
## replace style 2
getStyles(wb)[1:3] ## prints styles
replaceStyle(wb, 2, newStyle = newStyle)
## Save workbook
saveWorkbook(wb, "replaceStyleExample.xlsx", overwrite = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.