+ Reply to Thread
Results 1 to 12 of 12

Macro to vlookup across multiple columns

  1. #1
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Fort Worth, Texas
    MS-Off Ver
    Excel 2010
    Posts
    378

    Macro to vlookup across multiple columns

    Hi,

    I'm looking for a macro code that could automatically vlookup from sheet1 to sheet2 across many weeks.

    This is the code that I have but it only works for one column, I need it to loop to the next column starting from column D. Because this will be updated every week, next week sheet 1 will add one more week data, so If you could figure out a way that when the next week column has data it will vlookup from week 1 to the latest week. Appreciate if you can help.

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Fort Worth, Texas
    MS-Off Ver
    Excel 2010
    Posts
    378

    Re: Macro to vlookup across multiple columns

    I forgot my attachment.

    Macro Help.xlsm

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Macro to vlookup across multiple columns

    Why do you want to duplicate the values in sheet 1 to sheet 2.

    Why not just use the data in sheet 1?
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Fort Worth, Texas
    MS-Off Ver
    Excel 2010
    Posts
    378

    Re: Macro to vlookup across multiple columns

    This is just an example since I have to update my mastersheet from another sheet, If I can figure out the code to do this I'd be able to apply to my real situation.

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Macro to vlookup across multiple columns

    What you gonna do with the results on the second sheet.

    Whit another format an pivot table is an option.

  6. #6
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Fort Worth, Texas
    MS-Off Ver
    Excel 2010
    Posts
    378

    Re: Macro to vlookup across multiple columns

    All I need is to vloopup from sheet1 then copy and Paste values in sheet2 to get rid of formulas.

  7. #7
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Fort Worth, Texas
    MS-Off Ver
    Excel 2010
    Posts
    378

    Re: Macro to vlookup across multiple columns

    The problem is I could not figure out how to implement the macro code for different column index number in the Vlookup function to be changing when it moved to a new column.

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Macro to vlookup across multiple columns

    Dutch =ALS.FOUT(VERT.ZOEKEN($C2;Sheet1!$B$1:$BF$2500;KOLOM();0);"")

    English =IFERROR(VLOOKUP($C2,Sheet1!$B$1:$BF$2500,COLUMN(),0),"")

    See the attached file.
    Attached Files Attached Files
    Last edited by oeldere; 09-10-2013 at 03:53 PM.

  9. #9
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Fort Worth, Texas
    MS-Off Ver
    Excel 2010
    Posts
    378

    Re: Macro to vlookup across multiple columns

    We can't do this with macro, can we?

  10. #10
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Macro to vlookup across multiple columns

    Probably it can, but not by me (at the moment).

    But what's wrong with an formula?

    Why use VBA for this job?

  11. #11
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Fort Worth, Texas
    MS-Off Ver
    Excel 2010
    Posts
    378

    Re: Macro to vlookup across multiple columns

    I had the formula already, it just everyweek I have to do this with large volumn of data and just think an alternative way to make it easier via vba.

  12. #12
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Fort Worth, Texas
    MS-Off Ver
    Excel 2010
    Posts
    378

    Re: Macro to vlookup across multiple columns

    Thank you for your inputs, I really appreaciate it!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Vlookup on Multiple Columns
    By Delvesy888 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-19-2013, 07:52 PM
  2. Vlookup for a value from a multiple columns
    By seanyeap in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-31-2013, 11:39 AM
  3. Macro to copy 3 columns of data from multiple sheets into 3 columns on 1 sheet
    By bballdcm2007 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-15-2012, 04:37 PM
  4. [SOLVED] VLOOKUP, IF and multiple columns
    By André Francoeur in forum Excel General
    Replies: 3
    Last Post: 04-08-2006, 08:10 PM
  5. vlookup for multiple columns
    By JR in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-06-2006, 11:55 AM

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