+ Reply to Thread
Results 1 to 3 of 3

Loop seems to be repeating net result instead of running code.

  1. #1
    Registered User
    Join Date
    02-19-2014
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    9

    Loop seems to be repeating net result instead of running code.

    I have a simple but long code containing multiple and independent if then statements to perform on a cell. I then want all those if then statements to be repeated on every cell in the column until reaching an empty cell. It seems the Do Until Loop would do the trick, but instead of repeating multiple if then statements and coming to individual conclusions for each remaining cell, it's only applying the net effect of cell 1 on every single cell in the rest of the column. Restating the issue using the example code and attached workbook, I'd like the code to apply all 3 if then statements on all cells in column D. Instead it is correctly evaluating cell D2 but then ignoring the if thens for the rest of the cells by just applying the same net result it found for cell D2. Any thoughts?

    Please Login or Register  to view this content.
    Attached Files Attached Files

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

    Re: Loop seems to be repeating net result instead of running code.

    celltxt = ActiveCell.Text
    is outside of the loop and never changes...
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    02-19-2014
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Loop seems to be repeating net result instead of running code.

    beautiful. thanks!

+ 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. Need help running code with loop
    By newlearner1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-15-2014, 05:30 PM
  2. [SOLVED] Create a loop instead of repeating code
    By afpPaul in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-29-2012, 11:41 AM
  3. Macro - Moving to the next line and repeating code (Loop)
    By joe3 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-14-2012, 10:02 AM
  4. My code is running pretty slow with the loop that i have
    By Josh_123456 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-20-2007, 07:20 PM
  5. Stopping Code from Running whilst in Loop...
    By Chris Gorham in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-21-2005, 03:30 AM

Tags for this Thread

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