Hi I have code in VBA i want to convert it to VB.NET
the code
Dim lastrow As Integer
Dim curRow As Integer
Dim newrow As Integer
lastrow = exWS2.Cells.Rows.End(XlDirection.xlDown).Row
exWS2.Cells(8, 6).Value = "Max"
exWS2.Cells(8, 7).Value = "=Max(B2:B" & lastrow & ")"
newrow = 8
For curRow = 2 To lastrow
If exWS2.Cells(curRow, 2) = exWS2.Cells(8, 7).Value Then
newrow = newrow + 1
exWS2.Cells(newrow, 6).Value = exWS2.Cells(curRow, 1).Value
End If
Next curRow