Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Change default F12

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Change default F12

Correction to the last sentence: ...from F12 to something else.

"Dimitris" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Change default F12

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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Change default F12

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




  #5   Report Post  
Posted to microsoft.public.excel.programming
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








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Change default F12

Thanks a lot Peter

Dimitris

"Peter T" wrote:

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






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Change default F12

Good afternoon from Greece

One more last question. If you are in a cell in edit mode and press F12
excel ignore the previous code and the F12 is again Save as.... How can i
Pass this problem? If you are not in the cell but you have just select it,
the code work perfect

Thanks...


"Dimitris" wrote:

Thanks a lot Peter

Dimitris

"Peter T" wrote:

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






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Change default F12

Yes I see what you mean.

Normally when in edit mode all code is suspended. Besides F12 I'm also
surprised to see F1 and F7 appear to work. I don't know how to avoid that
and suspect it's not possible, at least not with normal VBA methods.

Look again at the code I posted and notice how if you pass say '2' to the
OnKeyEdit routine it disables F12 as a SaveAs shortcut (as intended).
However if you enter edit mode then press F12, it will call the SaveAs
dialog. Exit edit mode and the F12 key reverts to being disabled. I have
never noticed that behaviour before.

Regards,
Peter T


"Dimitris" wrote in message
...
Good afternoon from Greece

One more last question. If you are in a cell in edit mode and press F12
excel ignore the previous code and the F12 is again Save as.... How can
i
Pass this problem? If you are not in the cell but you have just select it,
the code work perfect

Thanks...


"Dimitris" wrote:

Thanks a lot Peter

Dimitris

"Peter T" wrote:

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








  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Change default F12

The problem that I have to deal with is that I will pass values from a
barcode reader. The reader have a predifed suffix that it is F12 and i must
not change it. With the code (not in edit mode in a cell) everything works
perfect. But in my case the barcode pass the data in edit mode in the cell
and so I can not bypass the F12.

And this is a big problem for me.

Thanks anyway Peter. If you found something I would be very happy to hear it.

Dimitris
"Peter T" wrote:

Yes I see what you mean.

Normally when in edit mode all code is suspended. Besides F12 I'm also
surprised to see F1 and F7 appear to work. I don't know how to avoid that
and suspect it's not possible, at least not with normal VBA methods.

Look again at the code I posted and notice how if you pass say '2' to the
OnKeyEdit routine it disables F12 as a SaveAs shortcut (as intended).
However if you enter edit mode then press F12, it will call the SaveAs
dialog. Exit edit mode and the F12 key reverts to being disabled. I have
never noticed that behaviour before.

Regards,
Peter T


"Dimitris" wrote in message
...
Good afternoon from Greece

One more last question. If you are in a cell in edit mode and press F12
excel ignore the previous code and the F12 is again Save as.... How can
i
Pass this problem? If you are not in the cell but you have just select it,
the code work perfect

Thanks...


"Dimitris" wrote:

Thanks a lot Peter

Dimitris

"Peter T" wrote:

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









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
store default printer, change printer and then restore default printer? Dennis Pedersen Excel Programming 0 November 14th 07 09:18 PM
How to change the default of 30 days change history Andy Smith[_2_] Excel Discussion (Misc queries) 6 October 23rd 07 11:57 PM
How to change the default directory Woody[_5_] Excel Programming 4 October 22nd 07 02:24 PM
How to change default row height rmt131 Excel Discussion (Misc queries) 0 August 18th 06 09:18 PM
Change Default Add-in Folder compound Excel Discussion (Misc queries) 2 July 13th 05 10:25 PM


All times are GMT +1. The time now is 02:00 PM.

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

About Us

"It's about Microsoft Excel"