BigEfromDaBX
BigEfromDaBX

Reputation: 177

google sheets search column for value using python

I can search a whole table in google sheets with python using the code below.

cell = sheet.find("searchCriteria")

or

cell = sheet.findall("searchCriteria")

My question is, How do I search a specific column in a table?

Upvotes: 2

Views: 2843

Answers (1)

Tanaike
Tanaike

Reputation: 201493

I believe your goal as follows.

  • You want to search with the specific column.
  • You want to achieve this using gspread with python.
    • From your script, I thought that you might use gspread.

For this, how about this modification? In this case, please use in_column as the argument.

Modified script:

When the value is searched from the column "C", please modify as follows. Ref

cell = sheet.find("searchCriteria", in_column=3)

and

cell = sheet.findall("searchCriteria", in_column=3)

Note:

  • When you test this, please update gspread to the latest version. Please be careful this.

References:

Upvotes: 1

Related Questions