M
Mcasteel
I guess I didnt fully understand the Match function, and I find codin
it this way easier. Although I still cant get it to work.
With the following code I get the message "ssn not found" even when th
ssn entered is listed in the column.
Do I need to convert the InputCustSSN to an Integer?
Private Sub cmdSelectRecord_Click()
Dim Cell As Range
Dim found As Boolean
Dim lookUpRange As Range
Dim lookupsheet As Sheet1
Dim InputCustSSN As String
Dim rngActive As Range
n = ActiveCell.Value
Set rngActive = ActiveCell.Range("f27:f307")
InputCustSSN = txtCustSSN
found = False
If n <> "" Then
For Each Cell In rngActive
If Cell.Value = InputCustSSN Then
found = True
Exit For
End If
Next Cell
End If
If Not found Then
MsgBox "SSN Not Found!"
Else
MsgBox "Customer SSN Found"
End If
End Sub
Its been a long day.
I promise I will take a refresher course on VBA as soon as the next on
is offered
it this way easier. Although I still cant get it to work.
With the following code I get the message "ssn not found" even when th
ssn entered is listed in the column.
Do I need to convert the InputCustSSN to an Integer?
Private Sub cmdSelectRecord_Click()
Dim Cell As Range
Dim found As Boolean
Dim lookUpRange As Range
Dim lookupsheet As Sheet1
Dim InputCustSSN As String
Dim rngActive As Range
n = ActiveCell.Value
Set rngActive = ActiveCell.Range("f27:f307")
InputCustSSN = txtCustSSN
found = False
If n <> "" Then
For Each Cell In rngActive
If Cell.Value = InputCustSSN Then
found = True
Exit For
End If
Next Cell
End If
If Not found Then
MsgBox "SSN Not Found!"
Else
MsgBox "Customer SSN Found"
End If
End Sub
Its been a long day.
I promise I will take a refresher course on VBA as soon as the next on
is offered