Forum Discussion
Jord4
Mar 11, 2020Copper Contributor
concatenate multiple
Hi guys, So I have a couple rows of data, column A has users populated and column B has things assigned to them. In column A the users are listed out various times depending on what they have assig...
Charla74
Mar 11, 2020Iron Contributor
You can create a user defined function for this per https://www.extendoffice.com/documents/excel/2706-excel-vlookup-return-multiple-values-in-one-cell.html (crucial part shown below):
1. Activate your worksheet which you want to vlookup multiple values into one cell.
2. Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window.
3. Click Insert > Module, and paste the following code in the Module Window.
VBA code: Vlookup to return multiple values in one cell
1 2 3 4 5 6 7 8 9 10 11 12 | Function MYVLOOKUP(pValue As String, pWorkRng As Range, pIndex As Long) 'Update 20150310 Dim rng As Range Dim xResult As String xResult = "" For Each rng In pWorkRng If rng = pValue Then xResult = xResult & " " & rng.Offset(0, pIndex - 1) End If Next MYVLOOKUP = xResult End Function |
- Jord4Mar 11, 2020Copper ContributorThanks!