This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Range targetRange = null; | |
Range firstFind = null; | |
Range currentFind=null; | |
targetRange = sheet.Columns[colName]; //シート内での検索範囲 | |
currentFind = targetRange.Find(keyword, //検索キー | |
Type.Missing, XlFindLookIn.xlValues, XlLookAt.xlPart, | |
XlSearchOrder.xlByRows, XlSearchDirection.xlNext, false, | |
Type.Missing, Type.Missing); | |
while (currentFind != null){ | |
if (firstFind == null){ | |
firstFind = currentFind; | |
} | |
else if (currentFind.get_Address(XlReferenceStyle.xlA1)== firstFind.get_Address(XlReferenceStyle.xlA1)){ | |
break; | |
} | |
currentFind = targetRange.FindNext(currentFind); | |
} |
0 件のコメント:
コメントを投稿