Thread: counting
View Single Post
  #2   Report Post  
schuurke28
 
Posts: n/a
Default


something like this?


Sub testje()
Dim i As Long, value As Variant, decimals As Long, wholenumbers As
Integer
For i = 1 To ActiveSheet.UsedRange.Rows.Count
value = Cells(i, 1).value
If IsNumeric(value) And Not IsEmpty(value) Then
'point or comma for numbers are depending of pc
settings
If InStr(1, value, ",") + InStr(1, value, ",") 0
Then
decimals = decimals + 1
Else
wholenumbers = wholenumbers + 1
End If
End If
Next i

MsgBox "# decimals : " & decimals & vbCrLf & "# wholenumbers : " &
wholenumbers

End Sub


--
schuurke28
------------------------------------------------------------------------
schuurke28's Profile: http://www.excelforum.com/member.php...o&userid=15818
View this thread: http://www.excelforum.com/showthread...hreadid=273137