+ Reply to Thread
Results 1 to 3 of 3

Run-time error 91 when using Range.Find | ONLY SOMETIMES

  1. #1
    Registered User
    Join Date
    02-20-2013
    Location
    Boston, Massachusetts
    MS-Off Ver
    365
    Posts
    13

    Run-time error 91 when using Range.Find | ONLY SOMETIMES

    I created a macro that is meant to detect the first cell in a specific range that DOES NOT have a border, before performing other tasks based on that information.

    This is the first part of my code:

    Please Login or Register  to view this content.
    When I open the macro file BEFORE the data file on which it is run, everything usually works fine.
    If I open the macro file AFTER the data file and try to run it, I receive this error message:
    "run-time error '91' Object variable or With block variable not set"

    The debugger highlights this section of the code:
    Please Login or Register  to view this content.
    Any idea why this works sometimes and not others?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Run-time error 91 when using Range.Find | ONLY SOMETIMES

    Hello sxj,

    Is this macro in your Personal.xlsm file?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    02-20-2013
    Location
    Boston, Massachusetts
    MS-Off Ver
    365
    Posts
    13

    Re: Run-time error 91 when using Range.Find | ONLY SOMETIMES

    Hi Leith,

    I'm not sure what a personal.xlsm file is (so I'm guessing the answer is no). All the macros I use are local though, individual workbooks saved to my desktop.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro Error on Filtering – “Run-time error ‘1004’ Autofilter method of range class failed
    By kschmit1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-25-2019, 11:49 AM
  2. Replies: 1
    Last Post: 08-08-2016, 04:35 PM
  3. [SOLVED] Run-time error '9': subscript out of range - error occurs on multiple computers except one
    By BrettE in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-06-2014, 11:19 PM
  4. Replies: 4
    Last Post: 11-15-2013, 05:03 PM
  5. VBA Code...error = run time error 1004 autofilter method of range class failed
    By Dariusd7 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-15-2013, 04:49 PM
  6. Run Time Error '6' Overflow - Macro That Find Text and Copy Range & Replace on Other Sheet
    By asgharhussaini in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-17-2013, 04:34 AM
  7. Run-time error '91' when 'On error goto' and cells.find
    By bjoern in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2008, 07:27 PM

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