View Single Post
  #2   Report Post  
anilsolipuram
 
Posts: n/a
Default


written a function only_text, which check whether a value is all text or
not



Sub macro()
Dim ch_text As Variant
ch_text = InputBox("enter value to test")
If only_text(ch_text) Then
MsgBox "no numeric value found/ all text values"
Else
If IsNumeric(ch_text) Then
MsgBox "numeric value"
Else
MsgBox "has numeric and text value"
End If
End If
End Sub



Function only_text(v As Variant)
Dim p_text As Integer
p_text = 1

For i = 1 To Len(v)
If IsNumeric(Mid(v, i, i + 1)) Then
p_text = 0
End If

Next
If p_text = 0 Then
only_text = False
Else
only_text = True
End If
End Function


--
anilsolipuram
------------------------------------------------------------------------
anilsolipuram's Profile: http://www.excelforum.com/member.php...o&userid=16271
View this thread: http://www.excelforum.com/showthread...hreadid=381736