1

I'm using the Google Sheets API v3 to generate a new spreadsheet. I would like to format some of the cell text so that they appear in bold.
How do you I do this using the API? I've looked at Google's documentation of the API, but it appears to be lacking any details for this. https://developers.google.com/googl-apps/spreadsheets/

Rubén
  • 34,714
  • 9
  • 70
  • 166
MakkyNZ
  • 2,215
  • 5
  • 33
  • 53
  • The URL has a typo. The correct is https://developers.google.com/google-apps/spreadsheets/ – Rubén Mar 22 '16 at 15:01
  • maybe you can find a answer here: http://stackoverflow.com/questions/16819806/bold-conditional-formatting-script-for-google-spreadsheets – Alaoui M. Mar 22 '16 at 15:45
  • That's for Google app scripts (i.e scripts within the spreadsheet) not the API. – MakkyNZ Mar 22 '16 at 16:03

2 Answers2

0

As of now I don't see other documents that can do that using the Sheets API. So I think the alternative way is to use apps script.

Google Apps Script lets you do new and cool things with Google Sheets. You can use Apps Script to add custom menus, dialogs, and sidebars to Google Sheets. It also lets you write custom functions for Sheets, as well as integrate Sheets with other Google services like Calendar, Drive, and Gmail.

Most scripts designed for Google Sheets manipulate arrays to interact with the cells, rows, and columns in a spreadsheet

Check this tutorial on how to use Apps Script is setting the cell format of Google Sheets.

You can also check again the SO ticket that provided by Alaoui M. if you want to use apps script.

KENdi
  • 7,576
  • 2
  • 16
  • 31
0

If you are really set on doing this, and I can't say that I recommend it.

But you could theoretically hack together a function that takes the number, converts it to a string, splits it and for each digit concatenate a new string based on the bold digit UTF-8 codes from the UTF-8 Mathematical Alphanumeric Symbols Block.

You can test with a single digit by entering cell formula =char(120812 + 6) which should generate a bold number 6.

In fact, if you want to go really crazy, you can do:

A1=1234.567890 A2=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"1",char(120813)),"2",char(120814)),"3",char(120815)),"4",char(120816)),"5",char(120817)),"6",char(120818)),"7",char(120819)),"8",char(120820)),"9",char(120821)),"0",char(120812)) & " huh? A bold choice sir, but I like it."

. huh? A bold choice sir, but I like it.

visibleman
  • 3,175
  • 1
  • 14
  • 27