Skip to content
Ahmed Kamal edited this page Jun 10, 2019 · 3 revisions

Formatting

book = Spreadsheet::Workbook.new
sheet = book.create_worksheet name: "Sheet 1"
row = sheet.row(1)

To Change All Cells Color on a Sheet

sheet.default_format = Spreadsheet::Format.new color: :blue

To Change Row Color

row.default_format = Spreadsheet::Format.new color: :red

To Change Row Font

row.default_format = Spreadsheet::Format.new font: Spreadsheet::Font.new("Courier New")

To Change Font Size

Spreadsheet::Font.new("Courier New", size: 14)

To Combine Multiple Formats

row.default_format = Spreadsheet::Format.new font: Spreadsheet::Font.new("Courier New", color: :red)