Hi,

I hope you can help as I'm sure this shouldn't be too complicated but I'm going round in circles and tearing my hair out!

I have an excel spreadsheet that has lots of data in it. Columns B and C both hold 11 digit reference numbers. Column C has data in every cell but column B only has data in some of the fields. Column C also has a lot of cells with the same value. Any cells that have the same value in column C will have the corresponding column B value either as an 11 digit number or in some cases i will be blank. If it has a value other than blank, it will be the same for all versions of this duplicate.

I am trying to write a script that will look through column C and for any duplicate values it will populate the corresponding cell in column B with the correct 11 digit number.

So for example
A    B    C
1    1    123
2         123
3         456
4    2    789
5    3    456
After the script would return

A    B    C
1    1    123
2    1    123
3    3    456
4    2    789
5    3    456
If anyone can help I would be so so grateful!