looking for a string within excel file range with like expression
Example
file excel look like below:
----------------------------------------------------------
# | A | B | C | D |
----------------------------------------------------------
1 | A VALUE1 | B VALUE1 | C VALUE1 | D VALUE1 |
----------------------------------------------------------
2 | A VALUE2 | B VALUE2 | C VALUE2 | D VALUE2 |
----------------------------------------------------------
now what I want to do is enter this string B VALUE2 C VALUE2
in TB_Search_Text.Text
to search for it
UPDATE
here is some more explanation for the case
Second string value C VALUE2
may exist or not what I mean
if I found B VALUE2
and C VALUE2
together
OR B VALUE2
OR C VALUE2
all these previous string cases will be considered as match.. I cannot concatenate the two string because it will ignore the last two match
for below method it will return string not found so what should I do to make it working ?
Microsoft.Office.Interop.Excel.Application oXL = new Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel.Workbook oWB;
Microsoft.Office.Interop.Excel.Range currentFind = null;
Microsoft.Office.Interop.Excel.Range firstFind = null;
Excel.Range oRng = oXL.get_Range("A1", "XFD1048576");
currentFind = oRng.Find(TB_Search_Text.Text,
missing,
Excel.XlFindLookIn.xlValues,
Excel.XlLookAt.xlPart,
Excel.XlSearchOrder.xlByRows,
Excel.XlSearchDirection.xlNext,
false,
missing,
missing);
C VALUE2
may exist or not what I mean if I foundB VALUE2
andC VALUE2
tougher ORB VALUE2
ORC VALUE2
all these previous string cases will be considered as match.. and if I concatenate the two string it will ignore the last two match – Cazares