+ Reply to Thread
Results 1 to 13 of 13

VBA - Trying to use For / Next Loop macro to go to next dynamic cell range in column 'C'

Hybrid View

  1. #1
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: VBA - Trying to use For / Next Loop macro to go to next dynamic cell range in column '

    At work. But I wrote something that is going to give you all the combinations. You can treat it as a template

    Sub Test()
    Dim i As Long, j As Long, LRi As Long, LRj As Long, x As Long
    
    LRi = Cells(Rows.Count, 1).End(xlUp).Row
    LRj = Cells(Rows.Count, 2).End(xlUp).Row
    x = 2
    
    For i = 2 To LRi
        For j = 2 To LRj
            Cells(x, 4) = Cells(i, 1)
            Cells(x, 5) = Cells(j, 2)
            x = x + 1
        Next j
    Next i
        
    End Sub
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    08-27-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: VBA - Trying to use For / Next Loop macro to go to next dynamic cell range in column '

    Thanks, but did you run my macro with the Book1.xlsm file?
    It will do to the 1st example cell range what I want to perform for the each cell range thereafter for itself. So if the 1st cell in the 1st cell range is 1 then it changes all the other cells in that one range to 1. Then I want it to look at the next cell range, say it's 1st cell starts with 15, it changes the remaining cells of that region to 15. Then it continues doing this for every active cell region until there are no more active cell regions.
    I don't think I follow how yours would apply, please explain if I just don't understand.

    Thanks

+ 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