Function re(CellLocation As Range, RegPattern As String) Dim OutPutStr As String Dim RegEx As Object, RegMatchCollection As Object, RegMatch As Object Set RegEx = CreateObject("vbscript.regexp") With RegEx .Global = True .Pattern = RegPattern End With OutPutStr = "" Set RegMatchCollection = RegEx.Execute(CellLocation.Value) For Each RegMatch In RegMatchCollection OutPutStr = OutPutStr & RegMatch Next re = OutPutStr End Function