Hope someone could help, I thought I had this but …

I have 2 columns: Part# and Code#. The Part# can have up to 30 code# s attributed. I need to go down list and pull all code#s for each different part# and place code in a columns (Code1, Code2, Code 3, etc).

Example:

Part# Code#


1234A AAAF
1234A AAFF
1234A AFFF
6789X ZZZA
6789X ZZAA
8777N PPPP
8777N PPPX
8777N PPXX
8777N PXXX
8777N XXXX

[B/]Need to populate codes across columns:[/B}

Part# Code1 Code2 Code3 Code4 Code5 etc.
1234A AAAF AAFF AFFF FFFF
6789X ZZZA ZZAA
8777N PPPP PPPX PPXX PXXXX XXXXX

I tried this:

=Offset(VLOOKUP(IF($A2=$A2,$A2,OFFSET($A2,1,0)),Code,2,FALSE),0,1)

I think I going in the right direction but not there. I’d appreciate any help, thanks!
~Gr8tDaze!