On looking at your code, I noticed there was no Function statement. So with a little experimenting, I revised the code by adding the Function definition and
then worked through existing code to identify the required input parameters. Here is the revised code. Good luck.
Code:
'---------------------------------------------
Function ChopIt(pstr As String, ParamArray VarMyVals() As Variant) As String
'Purpose: Remove a list of unwanted
' characters from a string
'Coded by: raskew
'Modified/revised:19/Aug/2012 --orange
'Inputs: From debug window:
' 1) ? chopit("123-45-6789", "-")
' 2) ? chopit(" the quick brown fox ", " ", "o")
'Output: 1) 123456789
' 2) thequickbrwnfx
'*******************************************
Dim strHold As String
Dim i As Integer
Dim n As Integer
On Error GoTo ChopIt_Error
strHold = Trim(pstr)
'check for entry
If UBound(VarMyVals) < 0 Then Exit Function
For n = 0 To UBound(VarMyVals())
Do While InStr(strHold, VarMyVals(n)) > 0
i = InStr(strHold, VarMyVals(n))
strHold = Left(strHold, i - 1) & Mid(strHold, i + Len(VarMyVals(n)))
Loop
Next n
ChopIt = Trim(strHold)
On Error GoTo 0
Exit Function
ChopIt_Error:
MsgBox "Error " & Err.number & " (" & Err.Description & ") in procedure ChopIt of Module AWF_Related"
End Function