2014-01-31 87 views
0

我正在將Excel VBA轉換爲C#(在Visual Studio .NET中使用VSTO項目)。下面的代碼令我困惑,因爲在C#中沒有類似的功能。VBA匹配到C#

result = Application.WorksheetFunction.Match(stringA, Range(stringB), 0) 
If result = 0 Then DoStuff 

如何在C#中複製上述功能? 感謝

回答

2

試試這個

result = Application.WorksheetFunction.Match(stringA, Range(stringB), 0); 
if (iTemp_result == 0) 
{ 
    DoStuff();  
} 
+0

其實我不可能得到Application.WorksheetFunction.Match工作..但你簡單的方向開了我的眼睛:) – Jim