Results 1 to 16 of 16

Looping Question

Threaded View

  1. #1
    Registered User
    Join Date
    05-14-2010
    Location
    Calgary, Canada
    MS-Off Ver
    Excel 2003
    Posts
    8

    Looping Question

    For N = 1 To 242
                Range("A8").Select
                CellNum = "R[N+8]C1"
                ActiveCell.Offset(N, I - 2).Select
                ActiveCell.FormulaR1C1 = "=VLOOKUP(VLOOKUP(Range((CellNum,'$_Names'R3C2:R365C3,2,FALSE),Sheets(I)!R9C2:R150C4,3,FALSE)"
            Next N

    This snippet of code is supposed to run inside another for loop that loops through the integer "I" where "I" is the worksheet number. The first loop steps through all worksheets in the file and copies information from each and pastes into the first "overview" sheet. The second loop, shown above is supposed to step through the values in each row and perform a nested VLOOKUP each time. I am having trouble with the syntax for this however. I think my problem is having the sheets object inside the vlookup formula. Help would be greatly appreciated. Thank you!!
    Last edited by Leith Ross; 05-13-2011 at 01:26 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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