nkamp
01-29-2008, 01:19 AM
Hello,
I looping through the rows in excel sheet by a While loop like:
While (Trim(Worksheets("openstaande orders").Range("A" & iRijTel)) <> "" _
Or Trim(CStr(Worksheets("openstaande orders").Range("J" & iRijTel))) <> "" _
Or Trim(CStr(Worksheets("openstaande orders").Range("K" & iRijTel))) <> "")
If (Trim(CStr(Worksheets("openstaande orders").Range("A" & iRijTel))) = Trim(stOpdrNr)) Then
FindOpdrnr = iRijTel
Exit Function
End If
iRijTel = iRijTel + 1
Wend
I check if some coloms are empty. And if so than the looping stops. But is there a possibility that you have a object or collection of the rows, so that is sure loop through all rows and that I'm independit of the user filling in the columns correctly.
Something like:
For each rw in Rowcollection
Next rw
Thanks in advance,
Nico
I looping through the rows in excel sheet by a While loop like:
While (Trim(Worksheets("openstaande orders").Range("A" & iRijTel)) <> "" _
Or Trim(CStr(Worksheets("openstaande orders").Range("J" & iRijTel))) <> "" _
Or Trim(CStr(Worksheets("openstaande orders").Range("K" & iRijTel))) <> "")
If (Trim(CStr(Worksheets("openstaande orders").Range("A" & iRijTel))) = Trim(stOpdrNr)) Then
FindOpdrnr = iRijTel
Exit Function
End If
iRijTel = iRijTel + 1
Wend
I check if some coloms are empty. And if so than the looping stops. But is there a possibility that you have a object or collection of the rows, so that is sure loop through all rows and that I'm independit of the user filling in the columns correctly.
Something like:
For each rw in Rowcollection
Next rw
Thanks in advance,
Nico