the code works perfectly when the input is found in the sheet,
but when the input is not found i get an error 91 (objectvariable or
blockvariable is not set).
and then you can end the code or debug, both i don't want.
because when you push the end button you have to start all over again.
and i don't want users to push the debug button, so they can screw up
the code.
this is what i have now.
-Private Sub txtBestellingArtikelCode2_Change()
ActiveWorkbook.Sheets("artikelen").Activate
Cells.Find(What:=txtBestellingArtikelCode2.Value,
After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False _
, SearchFormat:=False).Activate
txtBestellingArtikelOmschrijving2.Value = ActiveCell.Offset(0,
1).Value
End Sub-
what i want it to do with a false input is that the value of
txtBestellingArtikelOmschrijving2 is set to not known.
can anybody help me?:confused:

Signature
eyesonly1965
RAZA - 20 May 2006 12:06 GMT
Private Sub TextBox1_Change()
Set Avalue = Cells.Find(What:=TextBox1.Value, After:=ActiveCell,
LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False _
, SearchFormat:=False)
if Avalue is nothing then msgbox "Item not found" else Avalue.select
TextBox2.Value = ActiveCell.Offset(0, 1).Value
End Sub

Signature
RAZA