lundi 23 mai 2016

Convert VBA code to c# code (cell clear content)

I have a VBA excel code below. How can I convert this C# code ? Especially I need help to define ranges in 2nd and 3rd condition line


 For i = 2 To Range("A1").End(xlDown).Row 

    If Cells(i, "I").Value = "MTS" Or Cells(i, "I").Value = "WKS" Then Cells(i, "M").ClearContents

    If Cells(i, "A").Value = Cells(i - 1, "A").Value Then Range(Cells(i, "D"), Cells(i, "K")).ClearContents
    If Cells(i, "A").Value = Cells(i - 1, "A").Value Then Range(Cells(i, "N"), Cells(i, "O")).ClearContents   

 Next


Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire