+ Reply to Thread
Results 1 to 4 of 4

Run-time error 91 - Object variable or with block variable not set

  1. #1
    Forum Contributor
    Join Date
    11-06-2012
    Location
    New Jersey, US
    MS-Off Ver
    Excel 2016
    Posts
    182

    Run-time error 91 - Object variable or with block variable not set

    Hello - any idea on this error? Below is the code and this is where the error is occurring:

    arr = Split(findit.Offset(0, 1), " ")

    The code is supposed to open the latest modified file in the directory and loop through a column and copy names
    to another column in the other file.

    Thanks

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Run-time error 91 - Object variable or with block variable not set

    You may have situations where findit is nothing because there was no match. Test if findit is set before Splitting.

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    11-06-2012
    Location
    New Jersey, US
    MS-Off Ver
    Excel 2016
    Posts
    182

    Re: Run-time error 91 - Object variable or with block variable not set

    Hello -

    Yes findit was equal to Nothing.

    Also, looking at it, I need it to do two things:

    1) Chop off the first two characters
    2) and search based on the first eight characters

    Is that what its doing?

    Thanks

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Run-time error 91 - Object variable or with block variable not set

    Quote Originally Posted by twckfa16 View Post
    Hello -

    Yes findit was equal to Nothing.

    Also, looking at it, I need it to do two things:

    1) Chop off the first two characters
    2) and search based on the first eight characters

    Is that what its doing?

    Thanks
    Set findit = Range("E:E").Find(what:=Mid(ce, 2,8))

+ 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