+ Reply to Thread
Results 1 to 9 of 9

why am I getting "object variable or with block variable not set" error?

  1. #1
    Registered User
    Join Date
    09-15-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    56

    why am I getting "object variable or with block variable not set" error?

    Please Login or Register  to view this content.
    getting the error from here
    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: why am I getting "object variable or with block variable not set" error?

    What does your entire code look like?

  3. #3
    Registered User
    Join Date
    09-15-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    56

    Re: why am I getting "object variable or with block variable not set" error?

    a lil messy..

    Please Login or Register  to view this content.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: why am I getting "object variable or with block variable not set" error?

    It could it be because GradSerial isn't being found.

    What's in the range BoardRNG?

    Is it dates formatted as YYMMYY?
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    09-15-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    56

    Re: why am I getting "object variable or with block variable not set" error?

    Serial Month First Last
    201310 Oct-13 1-Oct-13 31-Oct-13
    201311 Nov-13 1-Nov-13 30-Nov-13
    201312 Dec-13 1-Dec-13 31-Dec-13
    20141 Jan-14 1-Jan-14 31-Jan-14
    20142 Feb-14 1-Feb-14 28-Feb-14

    looks like that. not formatted as YYMMYY I think.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: why am I getting "object variable or with block variable not set" error?

    That should have been YYYM, don't know where YYMMYY came from.

    Anyway, the important thing is what's actually in column A.

    Is it a date value formatted as YYYM, or is it a text value?

    The code you posted is looking for a text value, not a date.

  7. #7
    Registered User
    Join Date
    09-15-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    56

    Re: why am I getting "object variable or with block variable not set" error?

    the value in column A, "201310" is a text.

    I used Concat to merge the year and month together, 2013 + october

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: why am I getting "object variable or with block variable not set" error?

    The problem could still be that GradSerial isn't being found.

    Have you tried putting in the other arguments of Find eg After, LookAt, LookIn etc?

    If you don't include those then VBA uses the same settings as were used in the last search.

  9. #9
    Registered User
    Join Date
    09-15-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    56

    Re: why am I getting "object variable or with block variable not set" error?

    thx for the tip! ill try again tmr.. gonna head to bed

+ 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. Getting "Object variable or With block variable not set" error with Find function
    By enphynity in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-19-2013, 05:47 PM
  2. [SOLVED] Runtime Error "91" - Object Variable or With Block Variable not set
    By damidre in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-05-2013, 04:45 AM
  3. Getting an "Object variable or With block variable not set" error on this script
    By Lilivati in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-11-2012, 06:20 PM
  4. Replies: 1
    Last Post: 09-07-2012, 12:08 AM
  5. Error msgs: "Object varible or with block variable not set"; "subscript out of range"
    By menyanthe in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-26-2009, 04:58 PM

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