Filtering for valid characters

ElEdwards

Board Regular
Joined
Aug 29, 2002
Messages
220
I use Excel spreadsheets for entering data for a character generator at my TV station (WKYC-TV, Cleveland). The result is a crawl of information at the bottom of the screen, like you see on CNN, FOX, etc.
Usually, this works with out a problem. The producers enter this crawl information into specific cells, which I have formatted to turn red if they enter more than 255 characters of information (mainly because that's about as much as a person can read before losing their place).
Here's the problem:
The character generator (by Chyron) accepts characters with a decimal value from 3 to 191 as valid characters. If the decimal value is higher, the data is interpreted as commands, ranging from changing the speed to terminating the crawl.
I want to filter each of these cells so that only acceptable characters are sent (decimal 3 to 191) and it must be done as soon as the producer hits Enter.
The range is F2:F500.

Thanks for any help :smile:
 
Here is my version that finally works!! :smile:
==============================<pre>
Private Sub Worksheet_Change(ByVal Target As Range)

With Target
If .Column = 6 And .Row >= 2 And .Row<= 500 Then
Application.EnableEvents = False
NewText = ""
oldtext = Target.Text
If Len(oldtext) > 0 Then
For i = 1 To Len(oldtext)
If Asc(Mid(oldtext, i, 1)) >= 32 And Asc(Mid(oldtext, i, 1))<= 125 Then
NewText = NewText + Mid(oldtext, i, 1)
End If
Next i
Target.Value = NewText
End If

Application.EnableEvents = True
End If
End With

End Sub</pre>
_________________
El Edwards, the Voice of "You've Got Mail".
Go to http://www.makinwavs.com to order customized versions of the AOL (& non-AOL) wav files.
This message was edited by ElEdwards on 2002-09-12 14:34
 
Upvote 0

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
El,

If you put<pre> on the linebefore the code and</pre> on the next line after the code it makes it easier to ready (and copy and paste).

... you can go back into your last post and add them.
_________________
JRN

Excel 2000; Windows 2000
This message was edited by Jim North on 2002-09-12 14:28
 
Upvote 0

Forum statistics

Threads
1,222,902
Messages
6,168,938
Members
452,227
Latest member
sam1121

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top