I am familiar with writing conditional formatting rules in Google script.
I have a Google sheet that I have inherited that has been developed over a long period and conditional formatting rules have been manually inserted.
I am looking to copy all of the conditional formatting out of that google sheet using google apps script. The sheet has around 50 columns with many drop downs, and each dropdown, or combination of dropdowns, applies formatting. I think there are over 100 rules.
It would be VERY useful if I could get the conditional formatting out in a format that I could modify as needed and apply other (similar) sheets.
Any suggestions?
Mark
CodePudding user response:
SUGGESTION
Note: We normally do not code for you, but in this case I have a sample script that I can share with you that was derived from the samples of these Spreadsheet App classes listed below:
You can try using these Spreadsheet App classes in Apps Script:
-
- Save the script as a
- You can highlight any range that contains the Conditional Formatting that you'd like to copy to another sheet tab, then press the custom menu. It will show you the criteria type used and its value, as seen here (this sample was done on the CURRENT sheet) :
- If you press the Yes button, you will be prompted to change these details below:
- Update the Criteria Value Or you could use the default value by just pressing Ok to go to the next step:
- Type the Destination Sheet name
- Type the Range (in A1 Notation format) where you want to apply the copied Conditional Formatting
- After that, on the DESTINATION sample sheet, the Conditional Formatting has been applied to the range.
- Save the script as a