+ Reply to Thread
Results 1 to 2 of 2

For... Next Loop

Hybrid View

  1. #1
    Registered User
    Join Date
    03-29-2007
    MS-Off Ver
    365
    Posts
    70

    For... Next Loop

    Hi all, I have a simple code here. Presently, it loops from row 1 to 100. I would like to change it so it loops through the last row of column B that contains data. Thanks all for your help...

    Sub Example()
    Dim x
        For i = 1 To 100
           x = Cells(i, 1).Select
           Selection.Value = i + 1
        Next i
    End Sub

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    for i = 1 to cells(rows.count,"B").end(xlup).row
    rylo

+ 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