Hi,undefined

Can anybody help me with a macro formula that copies a cell value (column) from filtered selection.

ie.

In sheet 1 column "a" as my filter selection, column "c" is varying depending on filtered "a".

a b c
apple red 1
banana yellow 2
cat white 3
dog brown
egg orange

I need to consolidate in sheet 2 all the values of column "c" depending on all values of "a" with format as follows:
First I need all the values of a and b then, Column c is copied as values and transpose.

a b
apple red 1 2 3
banana yellow 3 2 1


Tnx!