+ Reply to Thread
Results 1 to 4 of 4

Can't find type mismatch

  1. #1
    Registered User
    Join Date
    05-21-2013
    Location
    Cape Town
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    9

    Can't find type mismatch

    I am trying to run the following code but I keep getting the error "Run-time error 91: Object variable or With block variable not set"

    Please Login or Register  to view this content.
    (I highlighted in brown the portion of the code that gets highlighted when I enter debugging mode)

    I have tried to introduce workingRange as
    Please Login or Register  to view this content.
    and then removing the Range functions from workingRange in the rest of the code, but then I get other errors. What confuses me the most is that before I saved and closed the workbook that contains this macro, I ran the macro once successfully, so I find it strange that this error would only appear now?

    I hope someone can see what is wrong with this code?
    Last edited by captive; 07-30-2013 at 10:51 AM. Reason: Gramatical error corrected

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Can't find type mismatch

    you will encounter that error if the value 1 is not found in the range you specify
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    05-21-2013
    Location
    Cape Town
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    9

    Re: Can't find type mismatch

    Thank you - I would never have thought about that!

    The range in question which is supposed to contain 1s is an indicator range that checks whether an entry is duplicated in the current sheet. Somehow I managed to copy and paste a portion of VBA code right below itself, causing a procedure to be executed twice, resulting in there not being any entries whatever left in the relevant sheet.

    It's all fixed now, though :-) Thanks!

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Can't find type mismatch

    you're welcome :-)

    please don't forget to mark the thread solved (click the 'thread tools' link at the top, then 'mark solved')

+ 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] Iterate Through Names, list unused: Type Mismatch with Cells.Find
    By tlafferty in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-26-2012, 04:03 PM
  2. Range and Find function error: Type Mismatch
    By VBNewb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-07-2011, 02:10 PM
  3. Run time error 13 Type Mismatch pointing to Find MatchCase=false
    By NukedWhale in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-26-2009, 11:53 PM
  4. Type Mismatch Error on Find Closest Match
    By carsto in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-12-2007, 11:07 AM
  5. [SOLVED] Help: Compile error: type mismatch: array or user defined type expected
    By lvcha.gouqizi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2005, 05:05 PM

Tags for this Thread

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