#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Error 91

I am using a piece of vba code to 'Find' a cell containing a string.
If the string is Not Found the code returns an error 91 - Object Variable or
With Block Variable not set which I am displaying in a msgbox
Is this the correct Error for a failure to find a string ?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Error 91

Yes. HTH Otto
"Jim" wrote in message
. uk...
I am using a piece of vba code to 'Find' a cell containing a string.
If the string is Not Found the code returns an error 91 - Object Variable
or With Block Variable not set which I am displaying in a msgbox
Is this the correct Error for a failure to find a string ?




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Error 91

Thanks Otto, that has set my mind at rest
Is there an Excel dialog box that I can use instead of a message box ?

Regards & TIA


"Otto Moehrbach" wrote in message
...
Yes. HTH Otto
"Jim" wrote in message
. uk...
I am using a piece of vba code to 'Find' a cell containing a string.
If the string is Not Found the code returns an error 91 - Object Variable
or With Block Variable not set which I am displaying in a msgbox
Is this the correct Error for a failure to find a string ?






  #4   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 232
Default Error 91

What do you mean dialog box? What are you trying to accomplish with the find
and then the subsequent failure or success?
Ben
--
When you lose your mind, you free your life.


"Jim" wrote:

Thanks Otto, that has set my mind at rest
Is there an Excel dialog box that I can use instead of a message box ?

Regards & TIA


"Otto Moehrbach" wrote in message
...
Yes. HTH Otto
"Jim" wrote in message
. uk...
I am using a piece of vba code to 'Find' a cell containing a string.
If the string is Not Found the code returns an error 91 - Object Variable
or With Block Variable not set which I am displaying in a msgbox
Is this the correct Error for a failure to find a string ?







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Error 91

I am using a piece of vba code to 'Find' a cell containing a string.
If the string is Found then I am updating a UserForm
If the string is Not Found I am displaying a Message box

Instead of the Message Box (above) I would like to display the built in
dialog that Excel displays, when the data is not found, when doing the Find
manually


"ben" (remove this if mailing direct) wrote in message
...
What do you mean dialog box? What are you trying to accomplish with the
find
and then the subsequent failure or success?
Ben
--
When you lose your mind, you free your life.


"Jim" wrote:

Thanks Otto, that has set my mind at rest
Is there an Excel dialog box that I can use instead of a message box ?

Regards & TIA


"Otto Moehrbach" wrote in message
...
Yes. HTH Otto
"Jim" wrote in message
. uk...
I am using a piece of vba code to 'Find' a cell containing a string.
If the string is Not Found the code returns an error 91 - Object
Variable
or With Block Variable not set which I am displaying in a msgbox
Is this the correct Error for a failure to find a string ?











  #6   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 232
Default Error 91

do you mean the find dialog box or the standard error box? I would Strongly
NOT reccomend showing the standard error box to a user that can create major
headaches, you could use this statement to analyze found or not found

dim ran as range
set ran = activesheet.cells.find(what:="mysearchdata")
if ran is nothing then
'not found
else
'found
end if


of course changing the criteria of searching to suit your needs

Ben

--
When you lose your mind, you free your life.


"Jim" wrote:

I am using a piece of vba code to 'Find' a cell containing a string.
If the string is Found then I am updating a UserForm
If the string is Not Found I am displaying a Message box

Instead of the Message Box (above) I would like to display the built in
dialog that Excel displays, when the data is not found, when doing the Find
manually


"ben" (remove this if mailing direct) wrote in message
...
What do you mean dialog box? What are you trying to accomplish with the
find
and then the subsequent failure or success?
Ben
--
When you lose your mind, you free your life.


"Jim" wrote:

Thanks Otto, that has set my mind at rest
Is there an Excel dialog box that I can use instead of a message box ?

Regards & TIA


"Otto Moehrbach" wrote in message
...
Yes. HTH Otto
"Jim" wrote in message
. uk...
I am using a piece of vba code to 'Find' a cell containing a string.
If the string is Not Found the code returns an error 91 - Object
Variable
or With Block Variable not set which I am displaying in a msgbox
Is this the correct Error for a failure to find a string ?










  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Error 91

I mean the error box that is displayed when a manual find fails
"Microsoft Office Excel cannot find the data you're searching for" with an
'OK' button


"ben" (remove this if mailing direct) wrote in message
...
do you mean the find dialog box or the standard error box? I would
Strongly
NOT reccomend showing the standard error box to a user that can create
major
headaches, you could use this statement to analyze found or not found

dim ran as range
set ran = activesheet.cells.find(what:="mysearchdata")
if ran is nothing then
'not found
else
'found
end if


of course changing the criteria of searching to suit your needs

Ben

--
When you lose your mind, you free your life.


"Jim" wrote:

I am using a piece of vba code to 'Find' a cell containing a string.
If the string is Found then I am updating a UserForm
If the string is Not Found I am displaying a Message box

Instead of the Message Box (above) I would like to display the built in
dialog that Excel displays, when the data is not found, when doing the
Find
manually


"ben" (remove this if mailing direct) wrote in
message
...
What do you mean dialog box? What are you trying to accomplish with the
find
and then the subsequent failure or success?
Ben
--
When you lose your mind, you free your life.


"Jim" wrote:

Thanks Otto, that has set my mind at rest
Is there an Excel dialog box that I can use instead of a message box
?

Regards & TIA


"Otto Moehrbach" wrote in message
...
Yes. HTH Otto
"Jim" wrote in message
. uk...
I am using a piece of vba code to 'Find' a cell containing a string.
If the string is Not Found the code returns an error 91 - Object
Variable
or With Block Variable not set which I am displaying in a msgbox
Is this the correct Error for a failure to find a string ?












  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Error 91

You can't access that dialog directly. Just use a MsgBox with the
same wording.


"Jim" wrote in message
...
I mean the error box that is displayed when a manual find fails
"Microsoft Office Excel cannot find the data you're searching
for" with an 'OK' button


"ben" (remove this if mailing direct) wrote
in message
...
do you mean the find dialog box or the standard error box? I
would Strongly
NOT reccomend showing the standard error box to a user that
can create major
headaches, you could use this statement to analyze found or
not found

dim ran as range
set ran = activesheet.cells.find(what:="mysearchdata")
if ran is nothing then
'not found
else
'found
end if


of course changing the criteria of searching to suit your
needs

Ben

--
When you lose your mind, you free your life.


"Jim" wrote:

I am using a piece of vba code to 'Find' a cell containing a
string.
If the string is Found then I am updating a UserForm
If the string is Not Found I am displaying a Message box

Instead of the Message Box (above) I would like to display
the built in
dialog that Excel displays, when the data is not found, when
doing the Find
manually


"ben" (remove this if mailing direct)
wrote in message
...
What do you mean dialog box? What are you trying to
accomplish with the
find
and then the subsequent failure or success?
Ben
--
When you lose your mind, you free your life.


"Jim" wrote:

Thanks Otto, that has set my mind at rest
Is there an Excel dialog box that I can use instead of a
message box ?

Regards & TIA


"Otto Moehrbach" wrote in message
...
Yes. HTH Otto
"Jim" wrote in message
. uk...
I am using a piece of vba code to 'Find' a cell
containing a string.
If the string is Not Found the code returns an error
91 - Object
Variable
or With Block Variable not set which I am displaying
in a msgbox
Is this the correct Error for a failure to find a
string ?














  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Error 91 - Thread Closed

Thanks Chip - I was begining to come to that conclusion

"Chip Pearson" wrote in message
...
You can't access that dialog directly. Just use a MsgBox with the same
wording.


"Jim" wrote in message
...
I mean the error box that is displayed when a manual find fails
"Microsoft Office Excel cannot find the data you're searching for" with
an 'OK' button


"ben" (remove this if mailing direct) wrote in
message ...
do you mean the find dialog box or the standard error box? I would
Strongly
NOT reccomend showing the standard error box to a user that can create
major
headaches, you could use this statement to analyze found or not found

dim ran as range
set ran = activesheet.cells.find(what:="mysearchdata")
if ran is nothing then
'not found
else
'found
end if


of course changing the criteria of searching to suit your needs

Ben

--
When you lose your mind, you free your life.


"Jim" wrote:

I am using a piece of vba code to 'Find' a cell containing a string.
If the string is Found then I am updating a UserForm
If the string is Not Found I am displaying a Message box

Instead of the Message Box (above) I would like to display the built in
dialog that Excel displays, when the data is not found, when doing the
Find
manually


"ben" (remove this if mailing direct) wrote in
message
...
What do you mean dialog box? What are you trying to accomplish with
the
find
and then the subsequent failure or success?
Ben
--
When you lose your mind, you free your life.


"Jim" wrote:

Thanks Otto, that has set my mind at rest
Is there an Excel dialog box that I can use instead of a message box
?

Regards & TIA


"Otto Moehrbach" wrote in message
...
Yes. HTH Otto
"Jim" wrote in message
. uk...
I am using a piece of vba code to 'Find' a cell containing a
string.
If the string is Not Found the code returns an error 91 - Object
Variable
or With Block Variable not set which I am displaying in a msgbox
Is this the correct Error for a failure to find a string ?
















Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting instances of found text (Excel error? Or user error?) S Davis Excel Worksheet Functions 5 September 12th 06 04:52 PM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
Automation Error, Unknown Error. Error value - 440 Neo[_2_] Excel Programming 0 May 29th 04 05:26 AM


All times are GMT +1. The time now is 01:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"