Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Replacing keystrokes

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Replacing keystrokes

Macros don't run when a user edits a cell. You could use the change event
to review what was entered and change it.

http://www.cpeason.com/excel/events.htm

--
Regards,
Tom Ogilvy

"Terry Lowe" wrote in message
...
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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Replacing keystrokes

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



In article ,
"Terry Lowe" wrote:

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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Switch between sheets with keystrokes? rich575 Excel Worksheet Functions 3 November 14th 07 03:21 AM
Recording a Macro that follows Keystrokes freakyquo Excel Discussion (Misc queries) 3 September 6th 07 04:42 PM
Lotus 123 keystrokes in Excel Joe Snow Excel Discussion (Misc queries) 1 March 2nd 05 09:09 PM
Select in Listbox using keystrokes [email protected] Excel Programming 2 May 6th 04 07:36 PM
Toggle Macro with KeyStrokes Cesar Zapata[_2_] Excel Programming 0 November 13th 03 05:07 PM


All times are GMT +1. The time now is 08:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"