Re: Finding a row in Excel
Take a look at this option:
Code:
Dim cell As String
For x As Integer = 1 To range.Rows.Count
For y As Integer = 1 To range.Columns.Count
cell = DirectCast(range.Cells(x, y), Excel.Range).Value.ToString()
If cell = "1000" Then
'This cell equals 1000, do something with it
End If
Next
Next
Re: Finding a row in Excel
Quote:
Originally Posted by
dday9
Take a look at this option:
Code:
Dim cell As String
For x As Integer = 1 To range.Rows.Count
For y As Integer = 1 To range.Columns.Count
cell = DirectCast(range.Cells(x, y), Excel.Range).Value.ToString()
If cell = "1000" Then
'This cell equals 1000, do something with it
End If
Next
Next
Do I need to Dim range as something?
Re: Finding a row in Excel
Yeah, range would be the cells that you wanted to iterate through.