Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello Excel users and experts,
Win XP, Excel 2002 A number is scanned into cell A1 and the below code is called through a change event macro. It finds that value in range aList and a date stamp is entered 2 columns to the right of the find value. This works fine. However, if there is NOT a value found in aList, then for some reason the date stamp is entered in first row of aList, 2 columns over. What would be the code to prompt a message box "Not Valid No." when there is no find? I can't figure out how to "catch" the fact that a number was not found. Sub BookReturnDate() Dim aList As Range Dim Bcode As Variant Bcode = Range("A1").Value If Bcode = "" Then Exit Sub Set aList = Range("G2:G2505") On Error Resume Next aList.Select Selection.Find(What:=Bcode).Activate ActiveCell.Offset(0, 2).Value = Now 'If no find then msgbox "Goof Up" End Sub Thanks for your help, Regards, Howard |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
colum is not found thats missing a column B how to find it | Excel Worksheet Functions | |||
FIND function does not return ZERO when text is not found | Excel Worksheet Functions | |||
How to find a row since I found a value in a column? see example | Excel Worksheet Functions | |||
Find text in another workbook and paste if found match - VBA | Excel Discussion (Misc queries) | |||
Copy Rows found using Find All feature | Excel Discussion (Misc queries) |