An apostrophe in VBA starts a "comment", so adding one to a line of code effectively turns it off while note deleting it.
Original with comments in green:
Function CleanAll(ByVal Txt As String) As String
Dim X As Long 'Code base by Rick Rothstein (MVP - Excel)
For X = 1 To Len(Txt)
If Mid(Txt, X, 1) Like "*[!0-9-]*" Then Mid(Txt, X, 1) = Chr(1) ' Leave only numbers
'If Mid(Txt, X, 1) Like "*[!A-Za-z ]*" Then Mid(Txt, X, 1) = Chr(1) ' Leave only letters and spaces
Next
CleanAll = Replace(Txt, Chr(1), "")
End Function
So you can create versions of this by changing the name of the function and then editing which line is commented and which is is not.
Bookmarks