Method: Worksheet#set_range_style

Defined in:
lib/surpass/worksheet.rb

#set_range_style(row_range, col_range, style, create_blanks = false) ⇒ Object

Change the style for a range of cells. If nil is supplied for row_range, the new style is supplied to every row (i.e. the entire column). Only changes style for cells which actually exist, so this does not paint anything which has not been written to.



259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/surpass/worksheet.rb', line 259

def set_range_style(row_range, col_range, style, create_blanks = false)
  row_range ||= 0..65535
  col_range ||= 0..255
  
  @rows.each do |i, r|
    next unless row_range.include?(i)
    r.cells.each do |c|
      next unless col_range.include?(c.col)
      c.set_style(style)
    end
  end
end