openxlsx2 icon indicating copy to clipboard operation
openxlsx2 copied to clipboard

Non-Consecutive dim gets lost

Open JanMarvin opened this issue 9 months ago • 0 comments

library(openxlsx2)

# dims <- "B7:B9,C6:C10,D5:D11,E5:E12,F6:F13,G7:G14,H6:H13,I5:I12,J5:J11,K6:K10,L7:L9"
dims <- "B7:B9,C6:C10,D5:D11,E5:E12,G7:G14,H6:H13,I5:I12,J5:J11,K6:K10,L7:L9"

wb <- wb_workbook()$
  add_worksheet(grid_lines = FALSE)$
  set_col_widths(cols = "A:M", widths = 2)$
  add_fill(dims = dims, color = wb_color("red"))


if (interactive()) wb$open()

I was toying around with coloring non consecutive cell ranges to create a heart shape using this as reference: Reference Heart shape

In my initial approach I missed a column, but to my surprise, column L is missing too (picture on the left). Even though it is in the code. If I use the full range, the image looks fine (picture on the right). Screenshot 2024-05-09 at 13 37 29 Screenshot 2024-05-09 at 13 38 03

JanMarvin avatar May 09 '24 11:05 JanMarvin