View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
ZoomZoom[_6_] ZoomZoom[_6_] is offline
external usenet poster
 
Posts: 1
Default Newbie VBA: How to test second position in a cell?

You may have noticed I got it the wrong way round.
Anyway, here it is again but correct, a bit neater & with more
validation:

Dim str As String
str = Sheet1.Cells(1, 1).Value
If (str < "") And (Len(str) 1) Then
Sheet1.Cells(1, 2).Value = Not (Asc(Mid(str, 2, 1)) 47 And
Asc(Mid(str, 2, 1)) < 58)
End If



---
Message posted from http://www.ExcelForum.com/