Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
If Cells.Find finds something
Excel Experts,
My code checks if a transaction is done correctly, and if it is not, puts a formula that displays the word "Violation" in a cell next to the transaction. In the following section, the code checks if the word "Violation" is displayed anywhere in the sheet. If there are no Violations, it displays a message box stating this, and if there is a violation, it goes to the first cell that displays "Violation". <<start code On Error GoTo errTrap Cells.Find(What:="Violation", LookIn:=xlValues).Activate errTrap: Answer = MsgBox("No Violations Found", vbOKOnly) <<end code What I'd like to add is code that, if "Violation" was found, pops up a message box stating, "Violation Found". Something like, If the line below finds something (or doesn't produce an error) "Cells.Find(What:="Violation", LookIn:=xlValues).Activate" MsgBox("Violation Found", vbOKOnly) What code would do this? Thanks in advance. Alan -- achidsey |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
formula finds values in apparently blank cells | Excel Worksheet Functions | |||
Copy info into empty cells below info, until finds cell with new d | Excel Discussion (Misc queries) | |||
lookup only finds #n/a's | Excel Discussion (Misc queries) | |||
find next finds too much. | Excel Programming | |||
Find finds nothing, and errors | Excel Programming |