+ Reply to Thread
Results 1 to 5 of 5

Runtime error 91 Objecr Variable of With block variable not set

  1. #1
    Registered User
    Join Date
    06-12-2006
    Posts
    29

    Runtime error 91 Objecr Variable of With block variable not set

    Hi,

    I'm hoping someone here can help with an irritating problem i am currently having in my macro.

    I am trying to search for a value in a worksheet but i keep getting the 'Object variable or With block variable not set' error on the following line of code:

    Please Login or Register  to view this content.
    i have no idea why i am getting this error.

    Anyone have any ideas how i can get around this.

    Thanks!
    Last edited by s_ali_hassan; 10-04-2010 at 05:32 AM. Reason: Solved

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Runtime error 91 Objecr Variable of With block variable not set

    You'd get that error if the find is unsuccessful. (you should never try and use the result of a Find on the same line).
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    06-12-2006
    Posts
    29

    Re: Runtime error 91 Objecr Variable of With block variable not set

    The thing is, i know that "08:00" exists on the worksheet where i am doing the find. When i do a manual ctrl+F, then it works.

    I am copying a worksheet from another workbook into my current worbook and then doing the find on the new worksheet.

    It always brings the same error. Do you know how i need to change my code to get around this as i'm not sure why it's not finding the value i'm searching for.

    Thanks

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Runtime error 91 Objecr Variable of With block variable not set

    Are you looking for a text string or a time?

    If the latter,

    Please Login or Register  to view this content.
    The octothorpe () delimits a date constant.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    06-12-2006
    Posts
    29

    Re: Runtime error 91 Objecr Variable of With block variable not set

    Thanks shg! that's sorted my problem out.

    (now just need to set this thread to 'Resolved'!)

+ 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