+ Reply to Thread
Results 1 to 4 of 4

Runtime error '91'; in my code please help!

  1. #1
    Forum Contributor
    Join Date
    11-03-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    246

    Runtime error '91'; in my code please help!

    Hi, I have a runtime error on the following code.
    The error says "Runtime error '91';
    Object variable or With block variable not set.

    The code looks at the value of InvRec Q7 to find the value within OutPurch C4:C25 , then copies InvRec V33:Y33 to column F on OutPurch and paste special on the same row as Q7 value from InvRec.

    Please Login or Register  to view this content.
    I have Googled the error but I do not understand vba to be able to fix it.
    Many thanks

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

    Re: Runtime error '91'; in my code please help!

    Try this...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    11-03-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    246

    Re: Runtime error '91'; in my code please help!

    Many thanks for that Alphafrog that works great. Any idea why the code I was using is now caput?

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

    Re: Runtime error '91'; in my code please help!

    You're welcome. The arguments I included for the .Find method make a difference in how it searches for a match. Probably the MatchCase:=False was the most likely correction. When using the .Find method, you should always set those argument values.

    The .Find Method
    Last edited by AlphaFrog; 05-08-2017 at 02:30 PM.

+ 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. Runtime error 13 problem with a code
    By elmnas in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-28-2015, 07:54 AM
  2. [SOLVED] Runtime error 1004 with my saveas code
    By Anto_BT in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-26-2015, 11:49 AM
  3. [SOLVED] Getting a runtime error with this code
    By rinser in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-20-2013, 10:22 AM
  4. [SOLVED] Runtime Error on Grouping code
    By dezzer_18 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-14-2012, 11:52 AM
  5. [SOLVED] Range error in code, runs alone but not inside my full program, giving runtime error 1004
    By charizzardd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-23-2012, 03:34 PM
  6. Runtime Error Code 1004
    By laks in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-19-2007, 07:08 PM
  7. runtime error 9 problem with this code
    By cuewoz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-03-2006, 09:54 AM

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