Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 -- Mcastee ----------------------------------------------------------------------- Mcasteel's Profile: http://www.excelforum.com/member.php...fo&userid=1569 View this thread: http://www.excelforum.com/showthread.php?threadid=27258 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Record Lookup | Excel Discussion (Misc queries) | |||
lookup the next matching record. | Excel Worksheet Functions | |||
lookup information in a row like a record | Excel Worksheet Functions | |||
auto filter missing record count & a fix idea | Excel Programming | |||
Anyone has any idea about XF: Extended Format (E0h) record ? | Excel Programming |