awalker89 / openxlsx

R package for .xlsx file reading and writing.
Other
364 stars 79 forks source link

Feature Request: Apply addStyle to entire column, rather than needing to reference row range #439

Open jacksonsj opened 5 years ago

jacksonsj commented 5 years ago

Expected Behavior

In addStyle function, ability to omit value for rows as a way to apply formatting to entire column (and vice versa to apply to entire row).

This would save significant space as Excel optimizes memory for formats applied to entire columns or rows.

Actual Behavior

Currently, addStyle requires rows be specified with a range.

Steps to Reproduce the Problem

  1. See test.xlsx for example where columns A-Z, rows 1-30000 have bold and numeric formatting applied. All cells are empty of any data. Resulting file size is 2 MB.

  2. See attached test2.xlsx for example where columns A-Z, all rows have bold and numeric formatting applied. All cells are empty of any data. Resulting file size is 8 KB.

sessionInfo()

zx8754 commented 3 years ago

Maybe a related SO post:

Current workaround, use some big (max) number.