A UDF is a User Defined Function. Add the code to a Module in the VBE and you will be set. If you type in B1, =GetLongURL(A1), and copy down, it will fill it for you.
If you want to fill column B just once, you can use this method. Note that I started filling from row 2 as row 1 is normally used for column names.
Sub FixShortURLs() Dim cell As Range For Each cell In Range("A2", Range("A" & Rows.Count).End(xlUp)) cell.Offset(0, 1).Value2 = GetLongURL(cell.Value2) Next cell End Sub