Gregorys05
Board Regular
- Joined
- Sep 24, 2008
- Messages
- 217
Hi All,
I have been using the following code in a excel spreadsheet and it is working fine, now i would like to transfer this to an access database.
To be able to count the amount of numeric values in a field.
E.G
152639 = 6
1A2A3A = 3
11ZZZZ=2
[/code]
Public Function CountNumeric(rCell As Range) As Long
Dim i As Long
For i = 1 To Len(rCell)
If IsNumeric(Mid(rCell.Value, i, 1)) Then
CountNumeric = CountNumeric + 1
End If
Next i
End Function
[/code]
Any ideas how i could do this either as a function or in a query?
Thanks
I have been using the following code in a excel spreadsheet and it is working fine, now i would like to transfer this to an access database.
To be able to count the amount of numeric values in a field.
E.G
152639 = 6
1A2A3A = 3
11ZZZZ=2
[/code]
Public Function CountNumeric(rCell As Range) As Long
Dim i As Long
For i = 1 To Len(rCell)
If IsNumeric(Mid(rCell.Value, i, 1)) Then
CountNumeric = CountNumeric + 1
End If
Next i
End Function
[/code]
Any ideas how i could do this either as a function or in a query?
Thanks