Search for non alphanumeric characters
try this code out, this also bolds out anything that has characters that are
Alphanumeric, that includes dashes, and I didn't know if you wanted to take
them into account.
Sub findnonalpha()
Dim cel As Range
Dim MPS As String
Dim cou As Integer
For Each cel In ActiveSheet.UsedRange
For cou = 1 To Len(cel)
MPS = UCase(Mid(cel, cou, 1))
If MPS < "0" Or MPS "9" Then
If MPS < "A" Or MPS "Z" Then
cel.Font.Bold = True
End If
End If
Next
Next
End Sub
--
When you lose your mind, you free your life.
Ever Notice how we use '' for comments in our posts even if they aren''t
expected to go into the code?
"jmdaniel" wrote:
I have a worksheet that has 40K rows of part numbers. As these part numbers
are from different suppliers, they have different formats. We are sending
this information out in Purchase Orders, via EDI, and we receive Error
messages when a non alphanumeric character is included a part number.
Is there a way I can use a macro to look at all of these part numbers, and
perhaps bold the ones that contain one or more non alphanumeric characters? I
have searched high and low, but have not run across a solution to this
(obviously).
|