Ir para o conteúdo principal

Como proteger várias planilhas de uma vez em Excel?

Supondo que você tenha uma pasta de trabalho que contém várias planilhas e agora precise proteger todas as planilhas ou algumas planilhas específicas, normalmente em Excel, você só pode proteger a planilha uma por uma com a função Proteger planilha, mas esse método é tedioso e demorado se houver várias planilhas que precisam ser protegidas. Como você protege várias planilhas de uma vez em Excel de forma rápida e fácil?

Proteja todas as folhas de uma vez com o código VBA

Proteja várias folhas de uma só vez com Kutools for Excel

Desproteja várias folhas de uma só vez com kutools for Excel


seta azul bolha direita Proteja todas as folhas de uma vez com o código VBA

Com o seguinte código VBA, você pode proteger todas as planilhas da pasta de trabalho ativa de uma vez com a mesma passagemword, faça assim:

1. Segure o ALT + F11 chaves, e abre o Microsoft Visual Basic para Aplicações janela.

2. Clique inserção > Móduloe cole o seguinte código no Janela Módulo.

Código VBA: proteja todas as planilhas em uma pasta de trabalho de uma vez:

Sub protect_all_sheets()
top: 
pass = InputBox("password?") 
repass = InputBox("Verify Password") 
If Not (pass = repass) Then 
MsgBox "you made a boo boo" 
Goto top 
End If 
For i = 1 To Worksheets.Count 
If Worksheets(i).ProtectContents = True Then Goto oops 
Next 
For Each s In ActiveWorkbook.Worksheets 
s.Protect Password:=pass 
Next 
Exit Sub 
oops: MsgBox "I think you have some sheets that are already protected. Please unprotect all sheets then running this Macro." 
End Sub

3. Então aperte F5 chave para executar o código e insira a senhaword para as planilhas protegidas na caixa de prompt, veja a captura de tela:

doc-proteger-múltiplas-folhas1-1

4. Clique OKe insira o passeword novamente para confirmar o passeword.

doc-proteger-múltiplas-folhas2-2

5. Então clique OK, e todas as folhas foram protegidas com o mesmo passeword.


seta azul bolha direita Proteja várias folhas de uma só vez com Kutools for Excel

Às vezes, você não deseja proteger todas as planilhas de sua pasta de trabalho e deseja proteger apenas algumas planilhas específicas; nessa situação, o código acima não funcionará. Mas com Kutools for Excel'S Proteger planilha utilitário, você pode proteger todas as folhas e folhas específicas de forma rápida e fácil.

Kutools for Excel : com mais de 300 úteis Excel suplementos, gratuitos para teste sem limitação em 60 dias

Depois de instalar Kutools for Excel, siga as seguintes etapas:

1. Clique Kutools MAIS > Proteger planilha, veja a captura de tela:

2. No Proteger planilha caixa de diálogo, selecione as folhas que deseja proteger. (Por padrão, todas as planilhas na pasta de trabalho atual são verificadas.) Veja a captura de tela:

doc-proteger-múltiplas-folhas4-4

3. E clique em OKe digite e confirme o passeword na caixa de diálogo Proteger planilha. Veja a captura de tela:

doc-proteger-múltiplas-folhas5-5

4. Então clique OK, as planilhas selecionadas foram protegidas.

Clique em Proteger planilha para saber mais sobre esse recurso.


seta azul bolha direita Desproteja várias folhas de uma só vez com kutools for Excel

Como você poderia desproteger várias planilhas protegidas em uma pasta de trabalho ao mesmo tempo? Claro, Kutools for Excel também fornece o Folha de trabalho desprotegida utilitário para você desprotegê-los de uma vez.

Siga os seguintes passos:

1. Abra sua pasta de trabalho que contém as planilhas protegidas.

2. Então clique Kutools MAIS > Folha de trabalho desprotegida, veja a captura de tela:

3. No Folha de trabalho desprotegida caixa de diálogo, as folhas protegidas são listadas na caixa de listagem e clique em Ok botão, veja a captura de tela:

doc-proteger-múltiplas-folhas7-7

4. E então um Folha de trabalho desprotegida uma caixa de diálogo aparece para lembrá-lo de inserir o passeword que você criou para proteger as planilhas, veja a captura de tela:

doc-proteger-múltiplas-folhas8-8

5. Depois de digitar o passeword, clique em Ok, todas as planilhas marcadas na caixa de listagem foram desprotegidas.

Nota: As planilhas devem ter a mesma passagemword.

Para saber mais sobre este recurso Desproteger Planilha.

Baixe e teste grátis Kutools for Excel Agora!


seta azul bolha direita Demonstração: proteja ou desproteja todas as planilhas de uma vez com Kutools for Excel

Kutools for Excel: com mais de 300 úteis Excel suplementos, gratuitos para teste sem limitação em 30 dias. Baixe e teste grátis agora!

Artigo relacionado:

Como desproteger várias planilhas de uma vez em Excel?

Melhores ferramentas de produtividade de escritório

Turbine suas planilhas: Experimente eficiência como nunca antes com Kutools for Excel

Recursos mais comuns: Localizar/destacar/identificar duplicatas   |  Excluir linhas em branco   |  Combine colunas ou células sem perder dados   |   Rodada sem Fórmula ...
Super pesquisa: VLookup de múltiplos critérios    VLookup de múltiplos valores  |   VLookup em várias planilhas   |   Pesquisa Difusa ....
Lista suspensa avançada: Crie rapidamente uma lista suspensa   |  Lista suspensa de dependentes   |  Lista suspensa de seleção múltipla ....
Gerenciador de colunas: Adicione um número específico de colunas     Mover colunas   |   Exibir colunas   |   Comparar colunas com Selecionar células iguais e diferentes ...
Recursos em destaque: Foco da Grade   |  Vista de Design   |   Grande Barra de Fórmula    Gerenciador de pastas de trabalho e planilhas   |  Biblioteca (Auto texto)   |  Data Picker   |  Combinar planilhas   |  Criptografar/Descriptografar Células    Enviar e-mails por lista   |  Super Filtro   |   Filtro Especial (filtro negrito/itálico/tachado...) ...
15 principais conjuntos de ferramentas12 Texto Ferramentas (Adicionar texto, Remover Personagens, ...)   |   50+ de cores Tipos (Gráfico de Gantt, ...)   |   Mais de 40 práticos Fórmulas (Calcule a idade com base no aniversário, ...)   |   19 Inclusão Ferramentas (Insira o código QR, Inserir imagem do caminho, ...)   |   12 Conversão Ferramentas (Números para Words, Conversão de moedas, ...)   |   7 Unir e dividir Ferramentas (Combinar linhas avançadas, Dividir células, ...)   |   Muito mais...

Kutools for Excel possui mais de 300 recursos, garantindo que o que você precisa está a apenas um clique de distância...

Suporta Escritório/Excel 2007-2021 e mais recentes, incluindo 365 | Disponível em 44 idiomas | Desfrute de um teste gratuito de 30 dias com todos os recursos.

guia kte 201905


Office Tab Traz a interface com guias para o Office e torna seu trabalho muito mais fácil

  • Ative a edição e leitura com guias em Word, Excel, Power Point, Publisher, Access, Visio e Project.
  • Abra e crie vários documentos em novas guias da mesma janela, em vez de em novas janelas.
  • Aumenta sua produtividade em 50% e reduz centenas de cliques do mouse para você todos os dias!
Comments (21)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I am trying to use this in a shared workbook but I get a Microsoft Visual Basic error "Run-time error '1004": Application-defined or object-defined error" I am just looking for suggestions on how to get around this. Any help would be appreciated
This comment was minimized by the moderator on the site
Occurs when sheet is already locked
This comment was minimized by the moderator on the site
Thanks for the wonder full tool to protect & unprotect all the sheets at a time. Please guide me I am able to unprotect all sheets in my work book at a time but when I run protect all sheets VBA Code then only first 4 sheets are protected & rest or left unprotected. Please help me to sort out the issue.
This comment was minimized by the moderator on the site
How do I mask the password using the VBA method? I can not find this information via google or F1 help files. Thanks in advance!
This comment was minimized by the moderator on the site
Hi I used this code now I it wont accept my password to get back into my spreadsheet !!
This comment was minimized by the moderator on the site
I have chart tabs and worksheets in my Excel 2013 workbook. The VBA coding above works for the protecting the worksheets but not the separate chart tabs. How do i password protect the multiple chart tabs and multiple worksheets in my workbook? Thanks!
This comment was minimized by the moderator on the site
Hey, I need some help, the above code was very helpful, but it locks the sort (auto filter as well) can you please provide code to solve that problem and also where it would be inserted. Thank you in advance.
This comment was minimized by the moderator on the site
Thank you! This is awesome, I was even able to modify the VBA code so that I could unprotect all sheets at once! :) Sub unprotect_all_sheets() top: pass = InputBox("password?") repass = InputBox("Verify Password") If Not (pass = repass) Then MsgBox "you made a boo boo" GoTo top End If For i = 1 To Worksheets.Count Next For Each s In ActiveWorkbook.Worksheets s.Unprotect Password:=pass Next Exit Sub oops: MsgBox "I think you have some sheets that are already protected. Please unprotect all sheets B4 running this Macro." End Sub
This comment was minimized by the moderator on the site
when i activated this VBA, hyperlink doesn't work. how can i make them work? tnx :)
This comment was minimized by the moderator on the site
I am suddenly having the 1004 error as well. Anyone find a solution?
This comment was minimized by the moderator on the site
I'm suddenly having the error 1004 issue. Have been using the macro for months now it randomly fails.
This comment was minimized by the moderator on the site
when I imput the code it comes up with "run time error 1004?? highlighting the following in yellow... s.Protect Password:=pass
This comment was minimized by the moderator on the site
I'm suddenly having the 1004 error as well. I have been using the macro for months but now it won't run.
This comment was minimized by the moderator on the site
Hi, I was having this issue too. Turns out it can't run if you have all sheets selected in the workbook. Try selecting just one sheet and then running.
This comment was minimized by the moderator on the site
As Kristin said, how do you unprotect them all at once?
This comment was minimized by the moderator on the site
So, how do I unprotect without kutools?
This comment was minimized by the moderator on the site
[quote]So, how do I unprotect without kutools?By cz[/quote] You can unprotect the worksheet without Kutools for Excel. You just need to right click on the sheet tab which you want to unprotect and click Unprotect Sheet command, and then enter your password. :-)
This comment was minimized by the moderator on the site
Thank you so much :-)
This comment was minimized by the moderator on the site
Great--so how to UNprotect them all at once? I'm an amateur, so I need more info.
This comment was minimized by the moderator on the site
Sub unprotect_all_sheets() top: pass = InputBox("password?") repass = InputBox("Verify Password") If Not (pass = repass) Then MsgBox "you made a boo boo" GoTo top End If For i = 1 To Worksheets.Count Next For Each s In ActiveWorkbook.Worksheets s.Unprotect Password:=pass Next Exit Sub oops: MsgBox "I think you have some sheets that are already protected. Please unprotect all sheets B4 running this Macro." End Sub
This comment was minimized by the moderator on the site
[quote]Great--so how to UNprotect them all at once? I'm an amateur, so I need more info.By Kristin Dzugan[/quote] :-) You can easily unprotect them as http://www.extendoffice.com/product/kutools-for-excel/excel-unprotect-multiple-sheets.html
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations