+ Reply to Thread
Results 1 to 9 of 9

Error 91

  1. #1
    Jim
    Guest

    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. #2
    Otto Moehrbach
    Guest

    Re: Error 91

    Yes. HTH Otto
    "Jim" <[email protected]> wrote in message
    news:[email protected]...
    >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. #3
    Jim
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > Yes. HTH Otto
    > "Jim" <[email protected]> wrote in message
    > news:[email protected]...
    >>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. #4
    ben
    Guest

    Re: 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" <[email protected]> wrote in message
    > news:[email protected]...
    > > Yes. HTH Otto
    > > "Jim" <[email protected]> wrote in message
    > > news:[email protected]...
    > >>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. #5
    Jim
    Guest

    Re: 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" <[email protected](remove this if mailing direct)> wrote in message
    news:[email protected]...
    > 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" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > Yes. HTH Otto
    >> > "Jim" <[email protected]> wrote in message
    >> > news:[email protected]...
    >> >>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. #6
    ben
    Guest

    Re: 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" <[email protected](remove this if mailing direct)> wrote in message
    > news:[email protected]...
    > > 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" <[email protected]> wrote in message
    > >> news:[email protected]...
    > >> > Yes. HTH Otto
    > >> > "Jim" <[email protected]> wrote in message
    > >> > news:[email protected]...
    > >> >>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. #7
    Jim
    Guest

    Re: 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" <[email protected](remove this if mailing direct)> wrote in message
    news:[email protected]...
    > 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" <[email protected](remove this if mailing direct)> wrote in
    >> message
    >> news:[email protected]...
    >> > 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" <[email protected]> wrote in message
    >> >> news:[email protected]...
    >> >> > Yes. HTH Otto
    >> >> > "Jim" <[email protected]> wrote in message
    >> >> > news:[email protected]...
    >> >> >>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. #8
    Chip Pearson
    Guest

    Re: Error 91

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


    "Jim" <[email protected]> wrote in message
    news:[email protected]...
    >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" <[email protected](remove this if mailing direct)> wrote
    > in message
    > news:[email protected]...
    >> 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" <[email protected](remove this if mailing direct)>
    >>> wrote in message
    >>> news:[email protected]...
    >>> > 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" <[email protected]> wrote in message
    >>> >> news:[email protected]...
    >>> >> > Yes. HTH Otto
    >>> >> > "Jim" <[email protected]> wrote in message
    >>> >> > news:[email protected]...
    >>> >> >>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. #9
    Jim
    Guest

    Re: Error 91 - Thread Closed

    Thanks Chip - I was begining to come to that conclusion

    "Chip Pearson" <[email protected]> wrote in message
    news:[email protected]...
    > You can't access that dialog directly. Just use a MsgBox with the same
    > wording.
    >
    >
    > "Jim" <[email protected]> wrote in message
    > news:[email protected]...
    >>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" <[email protected](remove this if mailing direct)> wrote in
    >> message news:[email protected]...
    >>> 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" <[email protected](remove this if mailing direct)> wrote in
    >>>> message
    >>>> news:[email protected]...
    >>>> > 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" <[email protected]> wrote in message
    >>>> >> news:[email protected]...
    >>>> >> > Yes. HTH Otto
    >>>> >> > "Jim" <[email protected]> wrote in message
    >>>> >> > news:[email protected]...
    >>>> >> >>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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1