I have a spreadsheet with hundreds of lines of data, coming from data validation lists.
Some of the data is highly relevant, therefore I would like it larger, some is useful but superfluous to most.
Different font size is fine. If anyone is an expert with though, different colours and format would be amazing
I would need the script to be dynamic in the sense that data to the left of the | is formatted one way and to the right of the | in another way.

I believe your goal as follows.
google-sheets-macros).CODEofNAME NAME | CODE.NAME NAME++|+.CODE.Different font size is fine. If anyone is an expert with though, different colours and format would be amazing, you want to modify the font size and foreground color of the text. In this case,formatyou expect is the bold and italic?NAME NAMEofNAME NAME | CODE.I think that above goal can be achieved using RichTextValue. In this answer, I would like to propose the sample script.
Sample situation:
This sample script supposes the sample situation that the value of
NAME NAME | CODEare put in the column "A". So in order to test it, please prepare this situation.Sample script:
Please copy and paste the following script to the container-bound script of Spreadsheet, and set the sheet name.
Result:
When you run the above script, the text styles of column "A" are reformatted and the text style of
CODEis modified, while the text style ofNAME NAMEofNAME NAME | CODEis not modified. And also, the text style of the cell without|is not modified. You can see the sample result at the following image.Note:
References:
Added:
When you want to convert the selected range, how about the following sample script? When you use this script, at first, please select the range and run this script. By this, the selected range is converted.
If you want to put the converted values to one right side of the column, please modify above script as follows.
From
To