If neither calculation inside a cell nor the need of a FunctionAccess service are accepted, you can atl least avoid the inner loop using the following code (e.g.):
Function decimalDigitsOnly(pString As String) As String
REM Chr and Asc aren't updated for characters with unicode
REM numbers >65535 (>&hFFFF).
Dim r As String, u As Long, j As Long, ch As String, co As Integer
r=""
u = Len(pString)
For j = 1 To u
ch = Mid(pString, j, 1) : co = Asc(ch)
If (co>47)AND(co<58) Then r = r & ch
Next j
decimalDigitsOnly = r
End Function
It’s not shorter, but hopefully more efficient.
An alternative:
Function decimalDigitsOnly(pString As String) As String
Dim r As String, u As Long, j As Long, ch As String
Const digits = "0123456789"
r=""
u = Len(pString)
For j = 1 To u
ch = Mid(pString, j, 1)
If InStr(digits, ch)>0 Then r = r & ch
Next j
decimalDigitsOnly = r
End Function