Match Text in Sheet Area

Quickly search an area of a Simul8 spreadsheet and return the location (in column/row coordinates) that exactly matches a text string.

Parameters

  • Sheet location - left/top of the area eg MySheet[5,2] if the area starts at column 5, row 2
  • Columns - Number of columns in the area
  • Rows - Number of rows in the area
  • Text to find – Text string to be found in the sheet area. The text to be found should be put between double quotation marks (e.g. “Find me”).

Alternatively a variable or spreadsheet reference can be used.

  • Returned Column - A data item (global or local) to receive the returned column number of the located cell
  • Returned Row - A data item (global or local) to receive the returned row number of the located cell

If the value is not found then column and row are returned as -1. If the value exists in more than one cell in the area only the first location is returned. Simul8 searches each column from the left of the area checking every cell in the left column first, then every cell in the next column etc.

Example

Match Text in Sheet Area MySheet[1,1],10,10,”Simul8”,gblColumn, gblRow

This example searches for the text sting “Simul8” in the spreadsheet area A1:J10 and returns the cell location using gblColumn (global number) and gblRow (global number).

You can find a simulation example where the use of “Match Text in Sheet Area” is applicable here: Match_Text_in_Sheet_Area.s8