View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
miek miek is offline
external usenet poster
 
Posts: 39
Default Test for alpha char

Thanks these functions are great help

"Chip Pearson" wrote:


Try some code like the following:

Function IsCharAlpha(C As String) As Boolean
IsCharAlpha = UCase(Left(C, 1)) Like "[A-Z]"
End Function

Function IsStringAlpha(s As String) As Boolean
IsStringAlpha = _
(UCase(s) Like Application.WorksheetFunction.Rept("[A-Z]",
Len(s))) _
And _
Len(s) 0
End Function


The IsCharAlpha function tests if a single character C is alpha. The
IsStringAlpha functions tests if a string of characters S is alpha.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)