Replacing keystrokes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to replace keystrokes the user types in cells of a spreadsheet. For
example, if they type a period "." I want to replace it with a colon ":".
I've tried combinations of OnKey with SendKeys but I cannot get it to work.
Does anyone have any suggestions on how to do this? Thanks.
 
You could make a temporary entry into the AutoCorrect list:

Private Sub Workbook_Activate()
Application.AutoCorrect.AddReplacement ".", ":"
End Sub

Private Sub Workbook_Deactivate()
Application.AutoCorrect.DeleteReplacement "."
End Sub
 

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

Back
Top