J
jammin1911
I've built a simple macro for excel and all is working very nicely
I've googled this error for an hour now and come up with many othe
people with the problem but no solutions...
the code:
Code
-------------------
Cells.Find(What:=txtfindvalue, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
-------------------
Produces and error: "Run-Time error '91': Object variable of With bloc
variable not set" if "txtfindvalue" is nowhere to be found. If it find
it, everything works nicely, if it doesnt.. i get that error.
Makes sense, but I'm fairly new and don't understand how to trap an
error in VB. All I'd like to do is trap it and produce my own erro
that won't crash the program.. a simple msgbox that will make a warnin
sound and say "String not Found", etc.
If anyone has any experience with this, please let me know - thanks i
advance
I've googled this error for an hour now and come up with many othe
people with the problem but no solutions...
the code:
Code
-------------------
Cells.Find(What:=txtfindvalue, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
-------------------
Produces and error: "Run-Time error '91': Object variable of With bloc
variable not set" if "txtfindvalue" is nowhere to be found. If it find
it, everything works nicely, if it doesnt.. i get that error.
Makes sense, but I'm fairly new and don't understand how to trap an
error in VB. All I'd like to do is trap it and produce my own erro
that won't crash the program.. a simple msgbox that will make a warnin
sound and say "String not Found", etc.
If anyone has any experience with this, please let me know - thanks i
advance