dim varSplit as variant
dim var as variant
varSplit = split("1234567890"...etc)
for each var in varSplit
... somore more code here...
next
Public Function ReplaceSpecial(varInput As Variant) As Variant
Dim strString As String
Dim x As Integer
For x = 1 To Len(varInput)
Select Case Asc(Mid(varInput, x, 1))
Case 32, 47 To 57, 65 To 90, 97 To 122
strString = strString & Mid(varInput, x, 1)
End Select
Next x
ReplaceSpecial = strString
End Function
Public Function SumDigits(varInput As String) As Long
Dim x As Integer
For x = 1 To Len(varInput)
if isNumeric(Mid(varInput, x, 1)) Then
SumDigits= SumDigits + Cint( Mid(varInput, x, 1))
End If
Next x
End Function
Now Total looks like 8880088888008888800888880088888.
How to make Total a sum of all those digits?
I need so much help with this.
Are you 100% sure that it will only ever contain the letter 'X'? Perhaps it might change in the future!rst!Total = Replace(rst!Total, "X", "0") to replace all X with 0.