I'm converting Excel VBA to C# (using a VSTO project in Visual Studio .NET). The bellow code is puzzling me, since there are no similar function in C#.

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

How can I replicate the above functionality in C#? Thanks

有帮助吗?

解决方案

Try this

result = Application.WorksheetFunction.Match(stringA, Range(stringB), 0);
if (iTemp_result == 0) 
{
    DoStuff();      
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top