Try this:
Use as a worksheet function - in Sheet1!B2, enter:![]()
Function Abbreviate(ByVal sInput As String) Dim vList() As Variant Dim l As Long With Sheet2 vList = .Range("A2", .Cells(Rows.Count, 2).End(xlUp)) For l = LBound(vList) To UBound(vList) sInput = Replace(UCase(sInput), vList(l, 1), vList(l, 2)) Next l End With Abbreviate = Replace(Trim(sInput), " ", "_") End Function
Formula:
=Abbreviate(A2)
Bookmarks