Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Apply format to block of cells #198

Closed
jymbob opened this issue Dec 17, 2014 · 2 comments
Closed

Feature request: Apply format to block of cells #198

jymbob opened this issue Dec 17, 2014 · 2 comments

Comments

@jymbob
Copy link

jymbob commented Dec 17, 2014

I can apply a format to a row, column, merge_range or cell.
worksheet.write(0, 0, "Hello", format)
I can apply a conditional format rule to a block of cells.
worksheet.conditional_format('A1:A4', {'type': 'text', 'criteria': 'containing', 'value': 'foo', 'format': format1})
It would be really handy to be able to apply a format to a block of cells too, to e.g. set an area of a spreadsheet to the same properties, regardless of values

@jmcnamara
Copy link
Owner

Hi @jymbob,

That would be handy but unlike conditional formatting it isn't supported by the file format and would required the module to parse the range up and create individual formats for each cell. This is deceptively difficult; for example adding a border to a 4x4 range of cells requires 9 unique formats.

It would be possible and it is planned but it isn't trivial. There is already an open tracker for this at #111 where you can add a +1 and close this one.

If you have more limited requirements you could probably create some helper functions of your own in the meantime.

Thanks for your suggestion.

John

@jymbob
Copy link
Author

jymbob commented Dec 17, 2014

Thanks for the prompt feedback @jmcnamara - for reference what I've done for the moment is apply a conditional format matching 'type': 'blank' early on. Closing and +1ing #111

@jymbob jymbob closed this as completed Dec 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants