Randriakotonjanahary Tolotra S Randriakotonjanahary Tolotra S - 10 months ago 65
Java Question

Java | How to find a value (row and column number) in range of google spreadsheet using API?

I am using the Java API (V4) to read and edit the data from a google sheet. So far, I am able to read and edit the data based on the row and column number (index).

  • What I am want to do is to localise a data by its specific value ( I want to get the row and the column number of a specific cell using its value).

So far this is a part of the working code I used to edit the data:

// Copy the format from A1:C1 and paste it into A2:C5, so the data in
// each column has the same background.
requests.add(new Request()
.setCopyPaste(new CopyPasteRequest()
.setSource(new GridRange()
.setDestination(new GridRange()

BatchUpdateSpreadsheetRequest batchUpdateRequest = new BatchUpdateSpreadsheetRequest()

Can anyone please help me?
Thank you in advance.

Answer Source

According to the documentation, you can find the value using : FindReplaceRequest() and .getFind();

String cellReq = (new FindReplaceRequest().setFind("samuel")).getFind();