Check that only ASCII chars are used
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count = 1 Then
CheckASCII Target
End If
End Sub
Sub CheckASCII(Target As Range)
Dim text As String
Dim ascii As Long
Dim pos As Long
text = Target.text
For pos = 1 To Len(text)
Select Case Asc(Mid(text, pos, 1))
Case 27 To 255 'CHECK THESE!
Case Else
Target.Interior.ColorIndex = vbRed
Exit Sub
End Select
Next
End Sub
"Makelei" wrote in message
...
Hi,
I just want to high light the cell with pink. I have about 30 000 rows and
30 columns in use.
This is to be used as data is entered to cell. Sub Worksheet_Change(ByVal
Target As Range)
BR
MakeLei
"Peter T" wrote:
So are you saying you want to check if any text cells contain characters
in
the range chr(x) where x is between 128 and 255
Also, could any formula cells return text with these characters.
For the result do you just want a yes/no answer or any information about
which cells contain non ASCII characte5rs
Regards,
Peter T
"Makelei" wrote in message
...
Hi,
xls and 2003
BR
MakeLei
"Peter T" wrote:
what sort of file, xls, txt....
Regards,
Peter T
"Makelei" wrote in message
...
Hi,
What would be the possibilities to check that only ASCII chars are
used
within one file?
Thanks in advance once again
Markku
|