PDA

View Full Version : convertir code VBA to VB.NET



mounanou944696844
2015-04-05, 04:24 PM
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


help me

peter
2015-04-06, 02:08 AM
VBa and VB.net have similar variable declarations.

Is there some reason you would not like to do it in LISP?