ActiveX
To search for data
-
To search for data in a particular column, use the SearchCol method and set the parameters as follows,
- Set the lCol parameter to specify the column to search.
-
Set the lRowStart and lRowEnd parameter to specify the rows at which to start and end searching.
To start at the beginning of the rows, set the lRowStart parameter to 0. To search all rows, set the lRowStart parameter to 0 and the lRowEnd parameter to –1.
- Set the Text parameter to specify the text or value for which to search.
- Set the SearchFlags parameter to specify the kind of search to perform (for example, match case or partial match).
-
To search for data in a particular row, use the SearchRow method and set the parameters as follows,
- Set the lRow parameter to specify the row to search.
-
Set the lColStart and lColEnd parameter to specify the columns at which to start and end searching.
To start at the beginning of the columns, set the lColStart parameter to 0. To search all columns, set the lColStart parameter to 0 and the lColEnd parameter to –1.
- Set the Text parameter to specify the text or value for which to search.
- Set the SearchFlags parameter to specify the kind of search to perform (for example, match case or partial match).
- Repeat step 1 or 2 as needed to return the locations of each occurrence of the text or value in the column or row you are searching. When the method returns –1, there are no more occurrences of the text or value in the specified column or row.