+ Reply to Thread
Results 1 to 3 of 3

Looping Error

  1. #1
    Registered User
    Join Date
    08-16-2007
    Posts
    50

    Looping Error

    Hello all,

    I am having some trouble with a loop. I have a working macro that I am trying to add a little fuctionality too. The working macro finds a cell that meets a given criteria, then inserts a cell with a keyword two cells below the found cell. The functionality I am trying to add is to see if the keyword is already there by searching for the keyword between the found cell and first cell with two periods below the found cell. If the keyword is there, replace it with the new value. If not, then insert a cell with a keyword two cells below the found cell.

    When I added the new fuctionality, I got an error that says "Object variable or With Block variable not set". It appears to be going into an infinate loop and gets stuck at the line of code that says
    Please Login or Register  to view this content.
    I have been messing with this for a couple hours and I can't see the problem. Both the working macro and the modified version are below and the spreadsheet is attached. Any help would be appreciated.

    Thanks!

    Working Macro:
    Please Login or Register  to view this content.


    Modified Macro with Error:
    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Looping Error

    Try Loop Until

    instead of Loop While. I don't think there is a "Loop While" .
    http://www.exceltip.com/st/Using_Loo...Excel/628.html
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    08-16-2007
    Posts
    50

    Re: Looping Error

    Thanks. But, I Tried that and it didn't work. Any other ideas?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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