View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_3_] Jim Thomlinson[_3_] is offline
external usenet poster
 
Posts: 983
Default Detecting Ctrl-Tabs in User Form input fields?

You can use the Clean function to remove non-printable characters something
like this:

Sheet1.Range("C3").Value = Application.Clean(Sheet1.Range("C2").Value)

This takes the Cell in C2 and removes the non printable characters and
places the resutl in C3

To test it put =CHAR(7) & "Text" in Cell C2...

HTH

"Don Wiss" wrote:

I have a user that somehow after entering a date in a user form text box
hit Ctrl-Tab a few times. This put some sort of non-prinatble characters
after the input. Then closing the form put the input in a spreadsheet cell
and formulas dependent on this cell errored out. And then macros reading
these errors crashed. Anyway to prevent or detect input like this?

Don <donwiss at panix.com.