0

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

Community
  • 1
  • 1
Jim
  • 2,760
  • 8
  • 42
  • 66

1 Answers1

2

Try this

result = Application.WorksheetFunction.Match(stringA, Range(stringB), 0);
if (iTemp_result == 0) 
{
    DoStuff();      
}
Behzad
  • 3,502
  • 4
  • 36
  • 63
Learner
  • 353
  • 9
  • 37
  • Actually I couldnt get the Application.WorksheetFunction.Match to work.. but your simple direction opened my eyes:) – Jim Jan 31 '14 at 08:20