Results 1 to 9 of 9

Looping through cells in Range

Threaded View

  1. #1
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Looping through cells in Range

    Hi,

    I can't tell why this is only looping through part of the range. I have tried resizing but still not working. The range is 5 * 10 and therefore the last x should be 50 but it only goes up to 10 making me think that the array is not two-dimensional. Any thoughts?

    Sub LoopThrougCells()
    
    Dim x As Long
    Dim Rng As Range
    Dim cl
    
    Set Rng = Range("A1:E" & Cells(Rows.Count, "A").End(xlUp).Row)
    cl = Rng
        For x = LBound(cl) To UBound(cl)
            MsgBox x
        Next
    End Sub
    abousetta
    Last edited by abousetta; 12-11-2011 at 02:09 AM.
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

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