Notifications
Clear all

Bloquear Tecla Ctrl +J

4 Posts
3 Usuários
0 Reactions
1,172 Visualizações
(@marciobin)
Posts: 204
Estimable Member
Topic starter
 

Boa noite ,
Dias atras tive certo problema com uma planilha que é o seguinte :

Mesmo com o projeto bloqueado , e os ribbons ocultos , a pessoa consegue ver as formulas teclando CTRL + J .
Gostaria de ajuda para bloquear essa combinacao quando o excel for aberto junto com esse codigo abaixo :

Option Explicit
Private Sub Workbook_Open()
Application.Visible = False
Application.ExecuteExcel4Macro " show.toolbar(""ribbon"",false)"


Dim barras, nTela, Cont
On Error Resume Next
 
    For Each barras In Application.CommandBars
        barras.Enabled = False
    Next
    Application.DisplayFullScreen = False
    ActiveWindow.DisplayHeadings = False
    Application.DisplayFormulaBar = False
    ActiveWindow.DisplayHorizontalScrollBar = True
    ActiveWindow.DisplayVerticalScrollBar = True
    ActiveWindow.DisplayWorkbookTabs = False
    Application.DisplayStatusBar = True

End Sub

Muito obrigado !

 
Postado : 29/04/2018 8:26 pm
(@klarc28)
Posts: 971
Prominent Member
(@jnexcel)
Posts: 298
Reputable Member
 

Marciobin, bom dia!

Tudo bem com você?

para o ctrl+j

Application.OnKey "^j", "" '

abaixo tem uma lista completa, só você remover alguma combinação que não use.

' Desabilitar CTRL + teclas do teclado
Application.OnKey "^a", "" '
Application.OnKey "^b", "" '
Application.OnKey "^c", "" '
Application.OnKey "^d", "" '
Application.OnKey "^e", "" '
Application.OnKey "^f", "" '
Application.OnKey "^g", "" '
Application.OnKey "^h", "" '
Application.OnKey "^i", "" '
Application.OnKey "^j", "" '
Application.OnKey "^k", "" '
Application.OnKey "^l", "" '
Application.OnKey "^m", "" '
Application.OnKey "^n", "" '
Application.OnKey "^o", "" '
Application.OnKey "^p", "" '
Application.OnKey "^q", "" '
Application.OnKey "^r", "" '
Application.OnKey "^s", "" '
Application.OnKey "^t", "" '
Application.OnKey "^u", "" '
Application.OnKey "^v", "" '
Application.OnKey "^w", "" '
Application.OnKey "^x", "" '
Application.OnKey "^y", "" '
Application.OnKey "^z", "" '

' desabilitar F1 ao F12


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}", "" 


' desabilitar alt+F1 ao F12

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 "^H", "" 'Ctrl+H replace
Application.OnKey "{F5}", "" 'F5 Goto
Application.OnKey "^+{+}", "" 'Ctrl+Shift+ + inserir dialog box
Application.OnKey "+{F11}", "" 'Shift+F11 novo worksheet
Application.OnKey "{F11}", "" 'F11 novo gráfico
Application.OnKey "^{F11}", "" 'Ctrl+F11 macro do Excel 4.0
Application.OnKey "+{F3}", "" 'Ctrl+F3 definir nome
Application.OnKey "{F3}", "" 'F3 colar nomes
Application.OnKey "^+{F3}", "" 'Ctrl+Shift+F3 criar nomes
Application.OnKey "^1", "" 'Ctrl+1 formatar células
Application.OnKey "^9", "" 'Ctrl+9 esconder linhas
Application.OnKey "^+{(}", "" 'Ctrl+Shift+( mostrar linhas
Application.OnKey "^0", "" 'Ctrl+0 esconder colunas
Application.OnKey "^+{)}", "" 'Ctrl+Shift+) mostrar colunas
Application.OnKey "%+{RIGHT}", "" 'Alt+Shift+RightArrow agrupa linhas/colunas
Application.OnKey "%+{LEFT}", "" 'Alt+Shift+LeftArrow desagrupa linhas/colunas
Application.OnKey "{F6}", "" 'F6 próximo painel
Application.OnKey "+{F6}", "" 'Shift+F6 painel anterior
Application.OnKey "^{F6}", "" 'Ctrl+F6 próxima janela
Application.OnKey "^+{F6}", "" 'Ctrl+Shift+F6 janela anterior
Application.OnKey "^{PGUP}", "" 'Ctrl+PgUp sheet anterior
Application.OnKey "^{PGDN}", "" 'Ctrl+PgDn sheet posterior
Application.OnKey "+{F12}", "" 'Shift+F12 salvar
Application.OnKey "^{F12}", "" 'Ctrl+F12 abrir
Application.OnKey "^{TAB}", "" 'Ctrl+Tab próxima janela
Application.OnKey "^+{TAB}", "" 'Ctrl+Shift+Tab janela anterior
Application.OnKey "^{-}", "" 'Ctrl+- exclui seleção
Application.OnKey "^{;}", "" 'Ctrl+; insere data
Application.OnKey "^{:}", "" 'Ctrl+: insere hora
Application.OnKey "{TAB}", "" 'Tab

'desabilitar botão direito no excel

Dim barras
On Error Resume Next
For Each barras In Application.CommandBars
barras.Enabled = False

Next
 
Postado : 30/04/2018 5:46 am
(@marciobin)
Posts: 204
Estimable Member
Topic starter
 

Boa tarde !
Muito obrigado JNEXCEL .

Exatamente isso . Vlew

 
Postado : 30/04/2018 11:31 am