best way to apply same style to multiple cells

Topics: Developer Forum, User Forum
Mar 23, 2011 at 3:02 PM


i have few styles defined which i will need to apply to specific cells on a worksheet. these cells are all around the worksheet and are not ranges, so the styles will need to be applied on each cell individually.

i already tried with applyFromArray, i defined all my styles in arrays and apply them on each cell i needed.

but, can somebody please tell me if there is another faster way to do this since i have tens of thousands of records to write and now it takes a long time?


Apr 6, 2011 at 7:57 PM

Try to dig into this code:



Apr 6, 2011 at 8:06 PM

Or shorter:


Apr 7, 2011 at 11:33 PM

Or apply the style to a row or column, or a range of cells.

Try something like: