+ Reply to Thread
Results 1 to 2 of 2

dynamic looping vlookup

Hybrid View

  1. #1
    Registered User
    Join Date
    02-11-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2013
    Posts
    98

    dynamic looping vlookup

    as the title states i am interested in a dynamic looping vlookup

    I import data from a csv file. then i create another worksheet to extract what i need via vlookup

    the source data will be dynamic. i.e the rows of data will be changing depending on my inputs to a completely different application.

    I can;t seem to figure this one out. the code is pretty self explanatory..any help would be great.

    
     data_source = Workbooks("Automation_base_case").book1.csv.Range(Cells(2, 1), Cells(finalrow, 15))
    
    'book1.csv is found in "Automation_base_case"
     
    finalrow_compile = Cells(Rows.Count, 3).End(xlUp).Row
            y = 2
            Cells(3, 2).Select
        
            For i = 3 To finalrow_compile
         ActiveCell.Application.WorksheetFunction.VLookup=(cells(i,1),data_source,y,false)
    
    'getting an error at the line above, it is looking for a close bracket after the cells(i,1) reference
         
         'Application.WorksheetFunction.VLookup(Cells(i, 1), book1.csv.Range(Cells(2, 1), Cells(finalrow, 15)), y, False)
    'just an attempt at the above function that didn;t work
            y = y + 1
            Next i
    
    still somewhat of a noob so your patience is much appreciated.thanks and take care
    Last edited by dabrows; 10-12-2011 at 10:47 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    Re: dynamic looping vlookup

    dabrows
    post up your workbook and describe what your desired end product should look like in relation to your data.
    I'm sure someone then will be able to sort you out.

+ 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