View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Change default F12

Sub test()
OnKeyEdit 1 ' 0 to reset to default
End Sub

Sub OnKeyEdit(SetType As Long)
Dim sMacro As String
If SetType = 0 Then
' reset default
Application.OnKey "{F12}"
Else
If SetType = 1 Then
sMacro = "EditCell"
Else
' some other number to send an empty string
' and clear F12 of any action, even default
End If
Application.OnKey "{F12}", sMacro
End If

End Sub

Sub EditCell()
Application.SendKeys ("{F2}")
End Sub


Regards,
Peter T

"Dimitris" wrote in message
...
With this line can I call Enter when I press F12 : Application.OnKey
"{F12}", "{ENTER}"

It is not working to me and I have the message:"I can not Find the macro
ENTER.

Thanks

Dimitris

"Peter T" wrote:

You can assign F12 to some other macro that does nothing, see OnKey in
help.
But unless you need F12 for other purposes what harm is it doing.

What's wrong with Ctrl-s as a built-in alternative to F12, or Alt-f, a.

Regards,
Peter T

"Dimitris" wrote in message
...
Hello there,

is it possible to change the F12 button from "Save As" and when the
user
press it to be equal as he had press "Enter" Button?
Also I would like to know if I can change the built-in shortcut for the
"Save As" from F2 to something else.

thanks

Dimitris