Results 1 to 2 of 2

VB Loop in a Loop

Threaded View

cdemaria VB Loop in a Loop 08-16-2007, 11:25 AM
mudraker cdemaria Welcome to... 08-16-2007, 05:27 PM
  1. #1
    Registered User
    Join Date
    08-14-2007
    Posts
    1

    VB Loop in a Loop

    I need to create a loop within a loop. First loop works fine as follows:
    -------------------------------
    x = 0
    Dim DirArray(0 To 80) As String
    Dim intI As Integer
    For intI = 0 To 80
        DirArray(intI) = Range("start").Offset(intI, 0).Value
    Next
       
    For x = 0 To 80
        lob = DirArray(x)
        Range("lob") = lob
         Calculate
        Sheets("WBB LOB Summary").Select
         ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    Next
    ----------------------------
    At the 'start' point, first loop works downward through rows. Second loop would work across columns in each row within the first loop. I will have to use a variable for 'y' (the across value) b/c the number of cells containing data can vary between 3 & 9, but I have a COUNTA in each row setup to use as the variable.

    So spreadsheet data would look like this with A being the 'start' cell:
    A 1 2 3
    B 1 2 3 4 5 6
    C 1 2 3 4

    I need to pickoff A1, A2, A3, B1, etc, picking up every sub-category on the sheet.
    Thanks in advance!
    Chris
    Last edited by cdemaria; 08-16-2007 at 09:22 PM.

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