nithinmurali / pygsheets

Google Sheets Python API v4
https://pygsheets.readthedocs.io/en/latest
Other
1.5k stars 220 forks source link

Sample for custom_formula #594

Open startupsandcode opened 6 months ago

startupsandcode commented 6 months ago

Would love an example on how to use a custom formula over a range dynamically.

Here is my "hypothesis":

sheet.add_conditional_formatting( [2, 2], [sheet.rows, sheet.cols], "CUSTOM_FORMULA", format={ "backgroundColorStyle": { "rgbColor": {"red": 0, "green": 1, "blue": 0} } }, condition_values=['=if(isnumber(),1,regexmatch(,"\d"))'] )

I'm not sure how to reference the I inserted above as it formats a range.