Here is a solid tutorial about creating barcodes in Excel http://www.wikihow.com/Create-a-Barcode
I have never used it personally, but if you look at step 4 it walks you through the process of installing a .bas file into the Excel VBA editor, they call it "=Code128()"
which allows you to use a custom User Defined Function that will generate the bar code. This may be what you are looking for.