Results 1 to 4 of 4

Macro using VLOOKUP with multiple matches between multiple sheets

Threaded View

Derrek0204 Macro using VLOOKUP with... 08-15-2011, 05:40 PM
JBeaucaire Re: Macro using VLOOKUP with... 08-15-2011, 07:31 PM
Derrek0204 Re: Macro using VLOOKUP with... 08-16-2011, 08:30 AM
JBeaucaire Re: Macro using VLOOKUP with... 08-16-2011, 06:20 PM
  1. #1
    Registered User
    Join Date
    07-27-2011
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    6

    Macro using VLOOKUP with multiple matches between multiple sheets

    I have a macro that compares data in Sheet1 Column B with Sheet2 Column C. If they match, the value in Sheet1 Column E is copied to Sheet2 Column D. Right now the macro only lists the first match and ignores any other matches after that. How do I modify the macro to include all matches in one long string (separated by spaces)?

    [code]
    Sub PlaceVLookupTMS()
    ' place in a standard module
    With Sheets("Sheet2")
    .Range("D2:D" & .Range("A" & .Rows.Count).End(xlUp).Row).FormulaR1C1 = _
    "=IFERROR(VLOOKUP(RC[-1],Sheet1!C[-2]:C[1],4,FALSE),"""")"
    End With
    End Sub
    [code]
    Attached Files Attached Files

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