M
mgoold2002
I'm moving some code from Excel vbs into a .NET context and I'm very
new to .NET. I'm trying to make this Excel vb code work in .NET. My
questions are: how do I reference cells correctly using the common
"cells(x,y)" reference, where x and y are integer variables. Also, how
do I verify that the cells are empty, since, according to the
documentation, the "IsEmpty" function does not work in .NET now?
Thanks for any help!
'//////////START CODE EXAMPLE///////////
Function getroworcol(roworcol, start)
Dim intoutside As Integer
Dim intctr
'DETERMINE START POINT OF SEARCH
If roworcol = 0 Then
outside = 200
Else
outside = 50
End If
'COUNT BACKWARDS FROM START POINT UNTIL FIND FILLED CELL
For intctr = outside To 1 Step -1
If roworcol = 0 Then
If IsEmpty(Cells(intctr, 1)) = False Then
Exit For
End If
ElseIf roworcol = 1 Then
If IsEmpty(Cells(1, intctr)) = False Then
Exit For
End If
End If
Next intctr
getroworcol = intctr
End Function
'////END CODE////////
new to .NET. I'm trying to make this Excel vb code work in .NET. My
questions are: how do I reference cells correctly using the common
"cells(x,y)" reference, where x and y are integer variables. Also, how
do I verify that the cells are empty, since, according to the
documentation, the "IsEmpty" function does not work in .NET now?
Thanks for any help!
'//////////START CODE EXAMPLE///////////
Function getroworcol(roworcol, start)
Dim intoutside As Integer
Dim intctr
'DETERMINE START POINT OF SEARCH
If roworcol = 0 Then
outside = 200
Else
outside = 50
End If
'COUNT BACKWARDS FROM START POINT UNTIL FIND FILLED CELL
For intctr = outside To 1 Step -1
If roworcol = 0 Then
If IsEmpty(Cells(intctr, 1)) = False Then
Exit For
End If
ElseIf roworcol = 1 Then
If IsEmpty(Cells(1, intctr)) = False Then
Exit For
End If
End If
Next intctr
getroworcol = intctr
End Function
'////END CODE////////