PDA

View Full Version : [SOLVED:] Get data in various cells based on a cell value from another sheet



kvinay_00
12-30-2019, 01:37 AM
Hello,

I am trying to fetch data from a data base in various cells based on another sheet based a cell value.

Have tried using vlookup/ index & match/ sumproduct but but could not get there. Sample file is attached for reference with required result.

Can anyone help please?

Thanks in advance!

p45cal
12-30-2019, 03:11 AM
Update cell D1 (which is linked to cell O2), click the button in cell H1.
To use formulae in this instance would be hard work, easier to use a one-line macro which employs Advanced Filter.

Sub blah()
Sheets("Data").Range("A2:M4500").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Sheets("Table").Range("O1:O2"), CopyToRange:=Sheets("Table").Range("A3:M3"), Unique:=False
End Sub

kvinay_00
12-30-2019, 03:21 AM
Wow Great! Thanks p45cal for your quick help!