This is the function that is giving the issue :
Its supposed to check if a string only has numbers 0-9
Public Function onlyNumbers(str As String)
For i = 1 To Len(str)
If Not (IsNumber(Mid(str, i, 1))) Then
onlyNumbers = False
End If
Next
onlyNumbers = True
End Function
Module:
Dim value as string
For j = 2 to 2205
value = Cells(j, 2)
value = Trim(Replace(Replace(value, "-", ""), ".", ""))
'Error gives on the if check (it highlights "value") :
If onlyNumbers(value) Then
' code goes on... no syntax error, execution only
callbefore or remove the().valuea word that is already used in vba, change the variable to some non vba word likevluor something.