+ Reply to Thread
Results 1 to 9 of 9

Can't figure out loop error

  1. #1
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103

    Can't figure out loop error

    Hi All,
    I am getting a Object variable or With Block variable not set error on the below code. The line of the error begins with RR =.
    Any ideas on what I am missing here? Also if someone could check over the remainder of the code after that line to make sure there are no errors as well that would be amazingly helpful. Many thanks

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Can't figure out loop error

    Set RR = ES.Cells(i, "c").Resize(COLUMNSIZE:=50)
    Ben Van Johnson

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Can't figure out loop error

    Max Excel rows is 1,048,576
    max integer is 32,767, so i should have been Dim'd as Long vs Integer

  4. #4
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103

    Re: Can't figure out loop error

    Thanks! I knew it was something simple. Althoug I am now getting a Type mismatch error on the below line. Can you explain where the issue is here?

    Please Login or Register  to view this content.

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Can't figure out loop error

    I have no way to test it, but:
    'Employee Skills'!" & RR
    looks like it should be:
    'Employee Skills'!" & RR.Address ?

  6. #6
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103

    Re: Can't figure out loop error

    Thanks again. I have delcared the address for RR on the below line. Is this how a Range variable works?
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103

    Re: Can't figure out loop error

    Oh wait I get it now, you mean literally add the .address. It works now but it is appearing with an @ at the start and not giving the full array result, only the first result.
    Any ideas on how to combat this?

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Can't figure out loop error

    Why do you expect to have an array result in a single cell: "OP.Range("C" & OFR)"
    It may help if you can attach a sample sheet.
    Quang PT

  9. #9
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103
    Quote Originally Posted by bebo021999 View Post
    Why do you expect to have an array result in a single cell: "OP.Range("C" & OFR)"
    It may help if you can attach a sample sheet.
    Because the TRUNCATE and FILTER functions do exactly that.

+ 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: 1
    Last Post: 01-13-2020, 03:59 PM
  2. [SOLVED] Trying to figure out how to code this For Loop
    By enichols in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-03-2019, 10:58 AM
  3. Replies: 4
    Last Post: 02-03-2014, 08:05 AM
  4. Trying to figure out a loop
    By frigate in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-02-2013, 11:02 AM
  5. [SOLVED] #NAME? Error, cant figure out why.
    By Speshul in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-08-2013, 01:06 PM
  6. Error I cannot figure out
    By Antonio in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-06-2006, 10:40 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