Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way:
Public Function FirstAlphaNumeric(ByVal Text) As String Dim sTemp As String Dim sResult As String Dim i As Long sTemp = UCase(Text) If sTemp Like "*[0-9,A-Z]*" Then For i = 1 To Len(sTemp) sResult = Mid(sTemp, i, 1) If sResult Like "[0-9,A-Z]" Then Exit For Next i End If FirstAlphaNumeric = sResult End Function In article , christopher ward wrote: i have a simple spreadsheet of christopher ward in cell A1 '''''''''''''''''brian wild in cell a2 ####jane brown in cell a3 ;;;;8888 in cell a4 I now need a VBA function or VBA code Macro that works out in each cell where the first alphanumeric character falls and returns the character.The length of the string is not fixed and will have various characters which are not a-z or 1-9 which are the ones I am interested in. If you reply to this post thanks in advance it is appreciated so my answers would be c b j 8 thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
range or string or long type | Excel Programming | |||
Determine data type in a string | Excel Programming | |||
Can I evaluate a function parameter(string type) as VBA souce code | Excel Programming | |||
testing for a string type | Excel Programming | |||
Type mismatch? string 2 a long?? | Excel Programming |