Advertisement
Guest User

Untitled

a guest
Sep 30th, 2014
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. For i = 0 To physid.Count - 1
  2. Dim physamount As Int64 = 0
  3.  
  4. range = oxlsheet.UsedRange 'Setting the range to be equal to the length of the excel file
  5. For rcnt = 1 To range.Rows.Count
  6.  
  7. varray = CType(range.Cells(rcnt, 4), Excel.Range) 'setting varray to the range of the excel workbook
  8. If (IsNumeric(varray.value)) Then
  9. temp = varray.value.ToString
  10. Else
  11. temp = varray.value
  12. End If
  13.  
  14. If (rcnt > 8) Then
  15. If (IsNumeric(varray.Columns(4).value)) Then
  16. temp2 = varray.Columns(4).value.ToString
  17. Else
  18. temp2 = varray.Columns(4).value
  19. End If
  20.  
  21. If (temp2 = physid.Item(i)) Then
  22. counter = rcnt
  23. Do While (String.IsNullOrEmpty(temp2) And counter < range.Rows.Count)
  24.  
  25. rangechecker = oxlsheet.Range("F" & counter).Select()
  26. If Integer.TryParse(rangechecker, 0) Then
  27.  
  28. If CInt(rangechecker) > 60000 And CInt(rangechecker) < 70000 Then
  29.  
  30. physamount = physamount + oxlsheet.Range("H" & counter).Select()
  31. Console.WriteLine(physamount)
  32. Console.ReadLine()
  33.  
  34. End If
  35. End If
  36. counter = counter + 1
  37. Loop
  38. End If
  39. End If
  40. Next
  41. 'Write results at the end
  42. Console.WriteLine(physid.Item(i))
  43. Console.WriteLine(physname.Item(i))
  44. Console.WriteLine(physamount)
  45. Console.ReadLine()
  46. Next i
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement