I need of a macro to perform VLOOKUP and return multiple results. there are two sheets (Sheet1 and Sheet2). the data I’m looking for in Sheet1 is in column C. the lookup value is in Sheet2, column A and want the results in column B but be horizontal.
example: for the lookup value in A1 I want the results to be in column B1 , C1 D1, E1 and etc. test1.xlsx
I am thinking you might be able to get a similar result with a pivot table rather than VBA
Create a pivot with column A header as a row value and column B header as column value, the result will be a matrix of column A values in rows and column B values in columns. If you filter on column A, the rows, for the lookup value, the only items to stay as column headers will be the matching values from column B.
Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.
I am thinking you might be able to get a similar result with a pivot table rather than VBA
Create a pivot with column A header as a row value and column B header as column value, the result will be a matrix of column A values in rows and column B values in columns. If you filter on column A, the rows, for the lookup value, the only items to stay as column headers will be the matching values from column B.