Detecting Ctrl-Tabs in User Form input fields?

D

Don Wiss

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>.
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top