VBA Copy cells after filter

%3CLINGO-SUB%20id%3D%22lingo-sub-2067924%22%20slang%3D%22en-US%22%3EVBA%20Copy%20cells%20after%20filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2067924%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20read%20several%20other%20discussions%20but%20still%20can't%20find%20anything%20that%20seems%20to%20match%20what%20im%20trying%20to%20do%20or%20that%20i%20understand%20enough%20to%20make%20use%20of.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20table%20on%20sheet%201%20which%20has%2016%20columns%20(A%20to%20P)%20with%20the%20headers%20starting%20from%20A3.%20I%20want%20to%20filter%20the%20table%20based%20on%20if%20Column%20P%20has%20yes%20in%20it.%20Only%20one%20row%20will%20have%26nbsp%3B%22yes%22%20at%20a%20time.%20I%20then%20want%20to%20copy%20the%20cell%20from%20Column%20A%2C%20N%20and%20O%20onto%20Sheet%202%20and%20paste%20them%20individually%20into%20B3%2C%20C3%20and%20D3.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20in%20advance.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2067924%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2068151%22%20slang%3D%22en-US%22%3ERe%3A%20VBA%20Copy%20cells%20after%20filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2068151%22%20slang%3D%22en-US%22%3EI%20would%20write%20a%20formula%20in%20cells%20Q4%20R4%20S4%20that%20are%20%3DA4%2C%20%3DN4%2C%20%3DO4%20(then%20copy%20these%20down%2C%20or%20even%20better%20if%20possible%20put%20your%20data%20is%20in%20a%20ctrl%20T%20Table%20so%20the%20formula%20automatically%20fills%20down)%20you%20can%20then%20highlight%20these%203%20new%20formula%20after%20filtering%20P%20and%20copy%20and%20paste%20them%20as%20values%20into%20Sheet3%20cell%20B3%3C%2FLINGO-BODY%3E
Occasional Visitor

Hi, 

I've read several other discussions but still can't find anything that seems to match what im trying to do or that i understand enough to make use of. 

 

I have a table on sheet 1 which has 16 columns (A to P) with the headers starting from A3. I want to filter the table based on if Column P has yes in it. Only one row will have "yes" at a time. I then want to copy the cell from Column A, N and O onto Sheet 2 and paste them individually into B3, C3 and D3. 

 

Thank you in advance.

 

2 Replies
I would write a formula in cells Q4 R4 S4 that are =A4, =N4, =O4 (then copy these down, or even better if possible put your data is in a ctrl T Table so the formula automatically fills down) you can then highlight these 3 new formula after filtering P and copy and paste them as values into Sheet3 cell B3

@MrNoSoul As a variant, and if you want to dynamically present the three values in Sheet2, based on where the "Yes" is in Sheet1. If the row in Sheet1 with "Yes" changes, the cells in Sheet2 will update automatically.

 

Two (of many different) options: 

1) a "double" FILTER, spilling the three cells in one go (provided your Excel version supports it)

2) a straight forward set of INDEX and MATCH functions

 

See attached workbook.