Getting an Excel Worksheet's Row

This procedure finds a row in a worksheet that contains a specific value.

This procedure is part of the Excel Book. A newer version of the Book is available via the BDK (v2).

Option 1: By Row Number

Syntax

get the worksheet's row
  the row number is {number}

Inputs

  1. number: The row number.

Option 2: By Column Label & Cell Value

Syntax

get the worksheet's row
  the column label is "{label}"
  the cell value is "{value}"

Inputs

  1. label: The label of the column, in quotes. Example: A, AE, D

  2. value: The specific value of the cell in the target row that you want to retrieve, in quotes.

Examples

Given the following table:

A
B
C

1

Character

House

Favorite Spell

2

Harry Potter

Gryffindor

Expelliarmus

3

Hermione Granger

Gryffindor

Alohomora

4

Ron Weasley

Gryffindor

Riddikulus

5

Luna Lovegood

Ravenclaw

Expecto Patronum

Here are two examples on how to retrieve row #5:

By Row Number

get the worksheet's row
  the row number is 5

By Column Label & Cell Value

get the worksheet's row
  the column label is "B"
  the cell value is "Ravenclaw"

Last updated

Was this helpful?