Results 1 to 6 of 6

Do While there are values in column A

Threaded View

  1. #6
    Valued Forum Contributor Steffen Thomsen's Avatar
    Join Date
    10-15-2010
    Location
    Kolding, Denmark
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    953

    Re: Do While there are values in column A

    Yes, you didn't specify in your question how the data would be populated, so i made an assumption.

    Then just insert a check on the cell content.

    Sub steffen()
    
    For i = 1 To Sheets(1).Range("A60000").End(xlUp).Row
       Cells(i, 2) = "Test"
       if cells(i,1) = "" then exit for
    Next i
    
    End Sub
    Or

    If you need the code to continue after the blank cell until the end of column a

    Sub steffen()
    
    For i = 1 To Sheets(1).Range("A60000").End(xlUp).Row
       if Not cells(i,1) = "" then Cells(i, 2) = "Test"
    Next i
    
    End Sub
    Last edited by Steffen Thomsen; 05-24-2012 at 05:07 AM.

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