There is a database of addresses that have new postal code. I am given one sheet with all of the codes and then given one sheet with the addresses. I want the user to input the address number, name and suffix so that the program can run through the list of codes and spit out the correct value.The address number that the user inputs must fall within a range that corresponds with the new postal codes. The numbers for this range are in the same row but in two different cells and I am having trouble figuring out how to capture the value in those two different cells. I want to check to see whether the value that the user inputs (ex. street number 4) falls into the range of the two values (ex. 1 to 75 or 75 to 1). The tricky part also is the values for the ranges are not in cosecutive order. This is the code I have so far.
[vba]
Sub hi()
Dim rowCount2 As Integer
Dim i As Integer
Dim j As Integer
Dim ValueOne As Variant
Dim Valuetwo As Variant
Dim Cell As Range
Sheets("Sheet2").Select
rowCount2 = Cells(Cells.Rows.Count, "A").End(xlUp).Row
For i = 1 To rowCount2
Range("D" & i).Select
ValueOne = Range("D" & i).Value
Range("E" & i).Select
Valuetwo = Range("E" & i).Value
If usrInputStreetNumber >= ValueOne And usrInputStreetNumber <= Valuetwo Then
End If
Next
End Sub
[/vba]