Raushan Raj

Raushan Raj

  • NA
  • 23
  • 12.2k

Convert VAB macro code to C# code

Apr 13 2017 2:36 AM
Option Explicit
Sub CopyRow()
Dim i As Integer
Dim lRow As Long, nextRow As Long
lRow = Sheets("Document List").Cells(Rows.Count, "R").End(xlUp).Row
For i = 1 To lRow
If InStr(1, LCase(Range("R" & i)), "n") <> 0 Then
nextRow = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row + 1
Range("A" & i & ":H" & i).Copy Destination:=Sheets("Sheet1").Range("A" & nextRow)
End If
Next i
End Sub
 
Please help me converting this VBA code to C#.
Whatever contents are getting extracted from the excel sheet needs to be mailed via outlook 2007 

Answers (1)