Hi!--I'm trying to set cell style to cells from 1 to 13 in first row using setCellStyle.if I use:
csSheetTitle <- CellStyle(wb) +Font(wb, heightInPoints = 12, isBold = TRUE) +Alignment(wrapText = TRUE, h = "ALIGN_CENTER") +Fill(backgroundColor = "lavender", foregroundColor = "lavender", pattern = "SOLID_FOREGROUND")setCellStyle(cells[[1,1]], csSheetTitle)setCellStyle(cells[[1,2]], csSheetTitle)setCellStyle(cells[[1,3]], csSheetTitle)setCellStyle(cells[[1,4]], csSheetTitle)setCellStyle(cells[[1,5]], csSheetTitle)it works Ok for the first 5 cells only, the first 5 cells in first row have a new style.But it give me an error if I add another one cell:
setCellStyle(cells[[1,1]], csSheetTitle)setCellStyle(cells[[1,2]], csSheetTitle)setCellStyle(cells[[1,3]], csSheetTitle)setCellStyle(cells[[1,4]], csSheetTitle)setCellStyle(cells[[1,5]], csSheetTitle)setCellStyle(cells[[1,6]], csSheetTitle)
Error : subscript out of bounds
How do I select the cell range for using setCellStyle properly?Thank you very much in advance!
You received this message because you are subscribed to the Google Groups "R-package-xlsx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to r-package-xlsx+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.