+ Reply to Thread
Results 1 to 9 of 9

Loop Does Not Stop

  1. #1
    Registered User
    Join Date
    03-23-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    50

    Loop Does Not Stop

    Hello all,

    I have a piece of code for a Do While loop that does not stop. It is entering formulas in every cell that is in a row containing data. I want it to stop entering formulas when it reaches a row that has nothing in it. The loop works perfectly except that it will not stop at the last row of data, it continues to row 65,535 or so.

    Please Login or Register  to view this content.
    The data is sourced from a txt file so part of my macro imports the txt file and converts it from text to columns.
    Last edited by NBVC; 07-14-2011 at 09:05 PM. Reason: Changed QUOTE tags to CODE tags

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Loop Does Not Stop

    Maybe try

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    Re: Loop Does Not Stop

    With acknowledgements to shg in 2008
    http://www.excelforum.com/excel-prog...y-or-null.html

  4. #4
    Registered User
    Join Date
    03-23-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Loop Does Not Stop

    Worked perfectly. Would you be able to explain why your code works but mine doesn't?

    Thanks!!

  5. #5
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Loop Does Not Stop

    IsEmpty works on a single cell, but not on multiple cells. I am not sure why, but I cannot get IsEmpty to return anything but false for multiple cells.

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Loop Does Not Stop

    or

    Please Login or Register  to view this content.



  7. #7
    Registered User
    Join Date
    03-23-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Loop Does Not Stop

    Can a Mod mark this thread as solved? I tried the same day that I made it but I do not have the edit option anywhere.

    Thanks!

  8. #8
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Loop Does Not Stop

    You should PM a mod so that they know it needs to be done.
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  9. #9
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Loop Does Not Stop

    I've posted this link so that Mods will see it.

+ 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