Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- For i = 0 To physid.Count - 1
- Dim physamount As Int64 = 0
- range = oxlsheet.UsedRange 'Setting the range to be equal to the length of the excel file
- For rcnt = 1 To range.Rows.Count
- varray = CType(range.Cells(rcnt, 4), Excel.Range) 'setting varray to the range of the excel workbook
- If (IsNumeric(varray.value)) Then
- temp = varray.value.ToString
- Else
- temp = varray.value
- End If
- If (rcnt > 8) Then
- If (IsNumeric(varray.Columns(4).value)) Then
- temp2 = varray.Columns(4).value.ToString
- Else
- temp2 = varray.Columns(4).value
- End If
- If (temp2 = physid.Item(i)) Then
- counter = rcnt
- Do While (String.IsNullOrEmpty(temp2) And counter < range.Rows.Count)
- rangechecker = oxlsheet.Range("F" & counter).Select()
- If Integer.TryParse(rangechecker, 0) Then
- If CInt(rangechecker) > 60000 And CInt(rangechecker) < 70000 Then
- physamount = physamount + oxlsheet.Range("H" & counter).Select()
- Console.WriteLine(physamount)
- Console.ReadLine()
- End If
- End If
- counter = counter + 1
- Loop
- End If
- End If
- Next
- 'Write results at the end
- Console.WriteLine(physid.Item(i))
- Console.WriteLine(physname.Item(i))
- Console.WriteLine(physamount)
- Console.ReadLine()
- Next i
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement