Notifications
Clear all

Desabilita parentes SendKey

4 Posts
2 Usuários
0 Reactions
1,142 Visualizações
(@fkleinbley)
Posts: 62
Trusted Member
Topic starter
 

Tem como desabilitar a entrada pelo teclado dos parentes ( ) ?
Usei os comandos abaixo, mas não funciona:
ThisWorkbook.Application.OnKey "+(0)", "Desabilita_Parentes"
ThisWorkbook.Application.OnKey "+(9)", "Desabilita_Parentes"
Tentei, pesquisei, mas não encontrei nada que resolva...
O código dos parentes não seriam 0 e 9?

 
Postado : 22/05/2015 8:03 am
(@miguel-70)
Posts: 207
Estimable Member
 

Tente usar um destes códigos;

'Esta pasta de Trabalho cole
Private Sub Workbook_Open()
   Desativar_Teclas_Atalhos 'modulo 1
   Desativar_Arasto 'modulo 11
   Desabilitar_Mouse_Click_Direito
End Sub

'Modulo
Public Sub Desativar_Teclas_Atalhos() 'Comandos para desligar teclas de atalhos.
Application.OnKey "%{F1}", ""
Application.OnKey "%{F2}", ""
Application.OnKey "%{F3}", ""
Application.OnKey "%{F4}", ""
Application.OnKey "%{F8}", ""
Application.OnKey "%{F9}", ""
Application.OnKey "%{F10}", ""
Application.OnKey "%{F12}", ""
Application.OnKey "%{=}", ""
'Application.OnKey "%{F11}", "" 'este comando desliga alt com f11
Application.OnKey "^o", ""
Application.OnKey "^a", ""
Application.OnKey "^g", ""
Application.OnKey "^c", ""
Application.OnKey "{F1}", ""
Application.OnKey "{F2}", ""
Application.OnKey "{F3}", ""
Application.OnKey "{F4}", ""
Application.OnKey "{F5}", ""
Application.OnKey "{F6}", ""
Application.OnKey "{F7}", ""
Application.OnKey "{F8}", ""
Application.OnKey "{F9}", ""
Application.OnKey "{F10}", ""
Application.OnKey "{F11}", ""
Application.OnKey "{F12}", ""
Application.OnKey "^{F9}", ""
Application.OnKey "+{F9}", ""
Application.OnKey "^{f1}", ""
Application.OnKey "^{f2}", ""
Application.OnKey "^{f3}", ""
Application.OnKey "^{f4}", ""
Application.OnKey "^{f5}", ""
Application.OnKey "^{f6}", ""
Application.OnKey "^{f7}", ""
Application.OnKey "^{f8}", ""
Application.OnKey "^{f9}", ""
Application.OnKey "^{f10}", ""
Application.OnKey "^{f11}", ""
Application.OnKey "^{f12}", ""
'Application.OnKey "^{p}", "" 'este comando desliga 'ctrl / p' impressora
Application.OnKey "^{i}", ""
Application.OnKey "^{l}", ""
Application.OnKey "^{t}", ""
Application.OnKey "^{d}", ""
Application.OnKey "^{g}", ""
Application.OnKey "^{h}", ""
Application.OnKey "^{f}", ""
Application.OnKey "^{x}", ""
Application.OnKey "^{;}", ""
Application.OnKey "^{w}", ""
Application.OnKey "^{r}", ""
Application.OnKey "^{j}", ""
Application.OnKey "^{v}", ""
Application.OnKey "^{u}", ""
Application.OnKey ("^n"), ","""
Application.OnKey "%{F1}", ""
Application.OnKey ("^o"), ""
Application.OnKey ("^s"), ""
Application.OnKey ("^a"), ""
Application.OnKey "%{F4}", ""
Application.OnKey "^{F5}", ""
Application.OnKey "{F5}", ""
Application.OnKey "{F2}", ""
Application.OnKey "^+{+}", ""
Application.OnKey "+{F11}", ""
Application.OnKey "{F11}", ""
Application.OnKey "^{F11}", ""
Application.OnKey "+{F3}", ""
Application.OnKey "{F3}", ""
Application.OnKey "^+{F3}", ""
Application.OnKey "^{1}", ""
Application.OnKey "^{9}", ""
Application.OnKey "^+{(}", ""
Application.OnKey "^+{)}", ""
Application.OnKey "%+{RIGHT}", ""
Application.OnKey "%+{LEFT}", ""
Application.OnKey "{F6}", ""
Application.OnKey "+{F6}", ""
Application.OnKey "^{F6}", ""
Application.OnKey "^+{F6}", ""
Application.OnKey "^{PGUP}", ""
Application.OnKey "^{PGDN}", ""
Application.OnKey "+{F12}", ""
Application.OnKey "^{F12}", ""
Application.OnKey "^{TAB}", ""
Application.OnKey "^+{TAB}", ""
Application.OnKey "^{-}", ""
Application.OnKey "^{;}", ""
Application.OnKey "^{:}", ""
Application.OnKey "{Escape}", "" 'Habilitar novamente Application.OnKey "{Escape}"
CommandBars("Cell").Enabled = False 'desabilita click mouse direito
End Sub

'Modulo
Public Sub Desativar_Arasto() 'ativar arastão do mouse configuração excel quando a planilha é fechada
    With Application
         .CellDragAndDrop = False
    End With
End Sub

'modulo
Public Sub Desabilitar_Mouse_Click_Direito()
CommandBars("Cell").Enabled = False 'desabilita click mouse direito
End Sub

Caso nenhum deste código não de certo, informe para que outro amigo possa lhe ajudar!

 
Postado : 22/05/2015 8:34 am
(@fkleinbley)
Posts: 62
Trusted Member
Topic starter
 

Funciona em parte, acho que até antes com meu código funcionava, mas funciona assim:
quando seleciono uma célula: tento digitar um parentes, ele funciona e não insere o parentes
mas quando eu dou um clique duplo na célula e edito o valor da célula ele aceita os parentes
será que tem como bloquear os parentes das duas situações?

 
Postado : 26/05/2015 10:21 am
(@miguel-70)
Posts: 207
Estimable Member
 

Boa tarde,
Vamos aguardar outro leitor com maior conhecimento do que eu para ti ajuda.

 
Postado : 26/05/2015 11:03 am