+ Reply to Thread
Results 1 to 4 of 4

Changing X1Down loop to work with empty rows

  1. #1
    Registered User
    Join Date
    09-03-2012
    Location
    Online
    MS-Off Ver
    Excel 2016
    Posts
    48

    Changing X1Down loop to work with empty rows

    Hi all,

    I have the following loop that goes through Column T and separates a cells contents in to new rows based on the presence of a line break Char(10). The function works providing that every cell in column T has something in it.

    How could I change this code so that it will work past cells that dont contain anything and still perform the intended function with those cells that do?


    Please Login or Register  to view this content.

    Example data attached
    Attached Files Attached Files

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Changing X1Down loop to work with empty rows

    Like this.
    Please Login or Register  to view this content.
    Last edited by bakerman2; 09-24-2016 at 07:35 PM.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Registered User
    Join Date
    09-03-2012
    Location
    Online
    MS-Off Ver
    Excel 2016
    Posts
    48

    Re: Changing X1Down loop to work with empty rows

    Thank you very much. Had me stumped!

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Changing X1Down loop to work with empty rows

    You're welcome and thanks for adding rep points.

+ 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. LOOP through visible rows till empty - error code?
    By brainzlp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-03-2016, 01:01 AM
  2. [SOLVED] Loop to delete empty rows needed
    By Smally in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-20-2013, 10:48 AM
  3. [SOLVED] Loop to copy rows from two worksheets until reaching empty row
    By Brukernavn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-21-2013, 05:06 AM
  4. [SOLVED] Worksheet Macro that hides empty rows does not work
    By Taktiker in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-22-2012, 11:11 AM
  5. Loop through groups of rows separated by empty cells
    By wmbower in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-30-2012, 02:53 PM
  6. Do-While loop within a do-while loop? Dealing with changing number of rows
    By Motox in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-02-2012, 12:59 AM
  7. Loop all sheetsand delete empty rows
    By Sige in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2005, 08:05 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