+ Reply to Thread
Results 1 to 4 of 4

Error - Object variable or With block variable not set

  1. #1
    Registered User
    Join Date
    09-12-2010
    Location
    Saratoga, CA, USA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Error - Object variable or With block variable not set

    I have two macros which work fine separately. I have combined them (see the line ' insert 12 columns and label) - now get an error.
    Object variable or With block variable not set
    I have no idea what this means. The macro executes all the way through to this section, then the error pops up:

    Please Login or Register  to view this content.

    Here's the full code:

    Please Login or Register  to view this content.
    Any help would be much appreciated!!
    Thanks,
    Mike

  2. #2
    Valued Forum Contributor
    Join Date
    03-21-2013
    Location
    cyberia
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Error - Object variable or With block variable not set

    a common cause for that error is if "This Year" doesn't occur in the range of interest

    it's often handled by this sort of code
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-12-2010
    Location
    Saratoga, CA, USA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Error - Object variable or With block variable not set

    kalak,

    Thanks for the response.

    "This Year" doses NOT occur in the range. It is on the next sheet and the range is defined for the first section on the first sheet.

    That's why I entered the line to change sheets "Expense Tracking" . Select

    How can I redefine the range for the second part on the next sheet?

    If you have any ideas - much appreciated!!!

    Mike
    Last edited by mactoolsix; 07-11-2014 at 08:31 PM.

  4. #4
    Valued Forum Contributor
    Join Date
    03-21-2013
    Location
    cyberia
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Error - Object variable or With block variable not set

    Mike,

    It's not totally clear to me just where you're at, but I modified your code a bit (modifications untested) so you can try it to see if it does anything sensible for you
    Please Login or Register  to view this content.

+ 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. Replies: 6
    Last Post: 12-21-2012, 08:03 AM
  2. Replies: 1
    Last Post: 09-25-2012, 08:03 PM
  3. [SOLVED] Intermittent Run-time Error 91: Object Variable or With Block variable not set
    By fraanchtoast in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-29-2012, 10:11 AM
  4. Error 91 object variable block variable not set when importing a CVS file
    By ReportBuilder2011 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-13-2011, 11:48 AM
  5. Find Method error: -Object variable with block set variable not set
    By bambino_32 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-02-2010, 01:18 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