XL2000
In my code I am getting data from an input box (Policy Number) and in a later routine I search all the records for specific policy numbers to update records. If I have multiple polcy numbers in a column from top to bottom say 12345, 1234, 123 and the User enters 123 in the Input Box I am getting the 12345 (first record with 123 in it) returned.
I cannot figure out the code to get the Exact matching record.
Here is the code I have:
Do
With worksheets(2).Range("J:J", "L:L"
sPolNum = InputBox(Prompt:="Enter Policy Number or Last Name:"
Sheets(2).Select
Set oPolNum = .Find(sPolNum)
If Not oPolNum Is Nothing Then
Sfound = oPolNum.Address
If Range(Sfound).Offset(0, 22).Value = "" Then
Sheets(2).Range("AZ1".Value = Sfound
Range(Sfound).EntireRow.Copy
Sheets(3).Select
Cells(65536, 1).End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Cells(65536, 1).End(xlUp).Offset(1, 0).Select
Else: sPolNum = InputBox(Prompt:="There are no active Calls with the requested Policy Number. Please Try Again:"
End If
End If
End With
Any help is appreciated.
In my code I am getting data from an input box (Policy Number) and in a later routine I search all the records for specific policy numbers to update records. If I have multiple polcy numbers in a column from top to bottom say 12345, 1234, 123 and the User enters 123 in the Input Box I am getting the 12345 (first record with 123 in it) returned.
I cannot figure out the code to get the Exact matching record.
Here is the code I have:
Do
With worksheets(2).Range("J:J", "L:L"
sPolNum = InputBox(Prompt:="Enter Policy Number or Last Name:"
Sheets(2).Select
Set oPolNum = .Find(sPolNum)
If Not oPolNum Is Nothing Then
Sfound = oPolNum.Address
If Range(Sfound).Offset(0, 22).Value = "" Then
Sheets(2).Range("AZ1".Value = Sfound
Range(Sfound).EntireRow.Copy
Sheets(3).Select
Cells(65536, 1).End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Cells(65536, 1).End(xlUp).Offset(1, 0).Select
Else: sPolNum = InputBox(Prompt:="There are no active Calls with the requested Policy Number. Please Try Again:"
End If
End If
End With
Any help is appreciated.