VLOOKUP to return multiple values?

CHC Consulting LLC

Active Member
Joined
Aug 14, 2008
Messages
346
How can I lookup cell A2 of workbook 'Billing Reconciliation' in column C of workbook '2010 REV LOG.XLS' and have it return all of the associated values related to in Column E, not just the first value but ALL values.

Is this possible?
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
It's not possible using VLookup, HLookup or Lookup as these will only ever return the first value.

It can only be done with VBA, are all the sheets to work on in the same workbook? will the results be pasted in the same workbook?
 
Upvote 0
They are not in the same workbook now, but can be if they need to. The results will be pasted in the 'Billing Reconciliation' workbook.

Excel 2010 btw.
 
Upvote 0
Try this but both workbooks must be open and you need to change the workbook names and the sheet names
Code:
Sub Macro2()
Dim wb As Workbook, Rng As Range, MyCell As Range
Set wb = Workbooks("testbooka.xls")
Set Rng = wb.Sheets("Sheet1").Range("C1:C" & wb.Sheets("Sheet1").Range("C" & Rows.Count).End(xlUp).Row)
For Each MyCell In Rng
If MyCell = ThisWorkbook.Sheets("Sheet1").Range("A2") Then
ThisWorkbook.Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0) = MyCell.Offset(0, 2).Value
End If
Next MyCell
End Sub
 
Upvote 0
testbooka is the workbook you are doing the lookup in so that will be 2010 REV LOG.XLS but you didnt specify sheet names or where you wanted the results which is why you had a generic answer :)

P.S aren't you a member at my site? (in sig below)
 
Upvote 0
yes, I am a member at your site. Most of the time I make my post at both sites. I got distracted this time and didn't get over to the cage. I like it very much.
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,299
Members
452,904
Latest member
CodeMasterX

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top