I have what I feel could be a silly question but it seems I can't find the answer:
- How to, while exporting to Excel, set a row/range to bold?
I know how to conditional format e.g.
format1 = workbook.add_format({'bg_color': '#FFC7CE',
'font_color': '#9C0006'})
...
worksheet.conditional_format('C2:AF41', {'type': 'cell', 'criteria': '<', 'value': 0, 'format': format1})
or even to format columns:
border_format = workbook.add_format({
'border': 1,
'align': 'center',
'font_size': 10
})
...
worksheet.set_column(0, 0, 30, border_format)
But let's say I want for row A1:A40 to be written in bold, whitout any particular criteria? I just want to set to bold or a color or any formatting a given range whatever data it may contain.
In this case, for instance, apply 'format1' to range A1:A40 whatever the values.
Does anyone know the answer?