Spread.Sheets
search メソッド
GC.Spread.Sheets 名前空間 > Workbook タイプ : search メソッド
検索条件。
指定したシート内のセルのテキストから、指定した文字列を指定した基準で検索します。
シンタックス
var instance = new GC.Spread.Sheets.Workbook(host);
var value; // Type: SearchResult

// パラメータ
var searchCondition; //タイプ: SearchCondition

value = instance.search(searchCondition);
function search( 
   searchCondition : SearchCondition
) : SearchResult;

パラメータ

searchCondition
検索条件。

戻り値の型

検索結果。
使用例
// 次のサンプルコードは、指定した検索条件を使用してアクティブシートを検索します。 activeSheet.getCell(2,3).value("testSearch"); var searchCondition = new GC.Spread.Sheets.Search.SearchCondition(); searchCondition.searchString = "testSearch"; searchCondition.startSheetIndex = spread.getActiveSheetIndex(); searchCondition.endSheetIndex = spread.getActiveSheetIndex(); searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder; searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText; searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.ignoreCase| GC.Spread.Sheets.Search.SearchFlags.useWildCards; var searchresult= spread.search(searchCondition); var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" + searchresult.foundRowIndex+", foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundSheetIndex+"]"; alert(str);
This example searches the active sheet using the specified search condition.
activeSheet.getCell(2,3).value("testSearch");
var searchCondition = new GC.Spread.Sheets.Search.SearchCondition();
searchCondition.searchString = "testSearch";
searchCondition.startSheetIndex = spread.getActiveSheetIndex();
searchCondition.endSheetIndex = spread.getActiveSheetIndex();

searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder;
searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText;
searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.ignoreCase| GC.Spread.Sheets.Search.SearchFlags.useWildCards;
var searchresult= spread.search(searchCondition);

var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" +
searchresult.foundRowIndex+", foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundSheetIndex+"]";
alert(str);
関連トピック

参照

Workbook タイプ