メインコンテンツへスキップ

Excelで一度に複数のワークシートを保護するにはどうすればよいですか?

複数のワークシートを含むブックがあり、すべてのワークシートまたは特定のワークシートを保護する必要がある場合、通常はExcelで、シートの保護機能を使用してシートをXNUMXつずつ保護することしかできませんが、この方法は面倒であり、保護する必要のあるシートが多数ある場合は時間がかかります。 Excelで一度に複数のシートをすばやく簡単に保護するにはどうすればよいですか?

VBAコードですべてのシートを一度に保護する

Kutools forExcelで一度に複数のシートを保護する

kutools forExcelで一度に複数のシートの保護を解除する


矢印青い右バブル VBAコードですべてのシートを一度に保護する

次のVBAコードを使用すると、アクティブなブックのすべてのシートを同じパスワードで一度に保護できます。次のようにします。

1。 を押し続けます Alt + F11 キー、そしてそれは開きます アプリケーション向け Microsoft Visual Basic 窓。

2に設定します。 OK をクリックします。 インセット > モジュール、次のコードをに貼り付けます モジュールウィンドウ.

VBAコード:ブック内のすべてのワークシートを一度に保護します。

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。 次に、 F5 キーを押してコードを実行し、保護されたシートのパスワードをプロンプトボックスに入力します。スクリーンショットを参照してください。

doc-protect-複数シート1-1

4に設定します。 OK をクリックします。 OK、パスワードを再入力して確認してください。

doc-protect-複数シート2-2

5。 次に、をクリックします OK、およびすべてのシートが同じパスワードで保護されています。


矢印青い右バブル Kutools forExcelで一度に複数のシートを保護する

ブック内のすべてのシートを保護したくなく、特定のシートのみを保護したい場合があります。この状況では、上記のコードは機能しません。 しかし、 Kutools for Excelさん ワークシートを保護する ユーティリティを使用すると、すべてのシートと特定のシートの両方をすばやく簡単に保護できます。

Kutools for Excel : 300以上の便利なExcelアドインがあり、60日以内に制限なしで無料で試すことができます

インストールした後 Kutools for Excel、次の手順に従ってください。

1に設定します。 OK をクリックします。 クツールズプラス > ワークシートを保護する、スクリーンショットを参照してください:

2。 の中に ワークシートを保護する ダイアログボックスで、保護するシートを選択します。 (デフォルトでは、現在のワークブック内のすべてのワークシートがチェックされます。)スクリーンショットを参照してください。

doc-protect-複数シート4-4

3。 をクリックします OK、次に、[ワークシートの保護]ダイアログボックスでパスワードを入力して確認します。 スクリーンショットを参照してください:

doc-protect-複数シート5-5

4。 次に、をクリックします OK、選択したワークシートは保護されています。

この機能の詳細については、[ワークシートの保護]をクリックしてください。


矢印青い右バブル kutools forExcelで一度に複数のシートの保護を解除する

ブック内の複数の保護されたワークシートを同時に保護解除するにはどうすればよいですか? もちろん、 Kutools for Excel また、 ワークシートの保護を解除する それらを一度に保護解除するためのユーティリティ。

次の手順で実行してください。

1。 保護されたワークシートを含むブックを開きます。

2。 次に、をクリックします クツールズプラス > ワークシートの保護を解除する、スクリーンショットを参照してください:

3。 の中に ワークシートの保護を解除する ダイアログボックスで、保護されたシートがリストボックスに一覧表示され、[ Ok ボタン、スクリーンショットを参照してください:

doc-protect-複数シート7-7

4。 そして、 ワークシートの保護を解除する ワークシートを保護するために作成したパスワードを入力するように促すダイアログボックスが表示されます。スクリーンショットを参照してください。

doc-protect-複数シート8-8

5。 パスワードを入力したら、をクリックします Ok、リストボックスでチェックされているすべてのワークシートは保護されていません。

注: ワークシートには同じパスワードが必要です。

このワークシートの保護解除機能の詳細については、こちらをご覧ください。

今すぐExcel用のKutoolsをダウンロードして無料トライアル!


矢印青い右バブル デモ:Kutools forExcelを使用してすべてのワークシートを一度に保護または保護解除する

Kutools for Excel:300以上の便利なExcelアドインがあり、30日以内に制限なしで無料で試すことができます。 今すぐダウンロードして無料トライアル!

関連記事:

Excelで一度に複数のワークシートの保護を解除するにはどうすればよいですか?

最高のオフィス生産性向上ツール

🤖 Kutools AI アシスタント: 以下に基づいてデータ分析に革命をもたらします。 インテリジェントな実行   |  コードを生成  |  カスタム数式の作成  |  データを分析してグラフを生成する  |  Kutools関数を呼び出す...
人気の機能: 重複を検索、強調表示、または識別する   |  空白行を削除する   |  データを失わずに列またはセルを結合する   |   数式なしのラウンド ...
スーパールックアップ: 複数の基準の VLookup    複数の値の VLookup  |   複数のシートにわたる VLookup   |   ファジールックアップ ....
詳細ドロップダウン リスト: ドロップダウンリストを素早く作成する   |  依存関係のドロップダウン リスト   |  複数選択のドロップダウンリスト ....
列マネージャー: 特定の数の列を追加する  |  列の移動  |  Toggle 非表示列の表示ステータス  |  範囲と列の比較 ...
注目の機能: グリッドフォーカス   |  デザインビュー   |   ビッグフォーミュラバー    ワークブックとシートマネージャー   |  リソースライブラリ (自動テキスト)   |  日付ピッカー   |  ワークシートを組み合わせる   |  セルの暗号化/復号化    リストごとにメールを送信する   |  スーパーフィルター   |   特殊フィルター (太字/斜体/取り消し線をフィルター...) ...
上位 15 のツールセット12 テキスト ツール (テキストを追加, 文字を削除する、...)   |   50+ チャート 種類 (ガントチャート、...)   |   40+ 実用的 (誕生日に基づいて年齢を計算する、...)   |   19 挿入 ツール (QRコードを挿入, パスから画像を挿入、...)   |   12 変換 ツール (数字から言葉へ, 通貨の換算、...)   |   7 マージ&スプリット ツール (高度な結合行, 分割セル、...)   |   ... もっと

Kutools for Excel で Excel スキルを強化し、これまでにない効率を体験してください。 Kutools for Excelは、生産性を向上させ、時間を節約するための300以上の高度な機能を提供します。  最も必要な機能を入手するにはここをクリックしてください...

説明


Officeタブは、タブ付きのインターフェイスをOfficeにもたらし、作​​業をはるかに簡単にします

  • Word、Excel、PowerPointでタブ付きの編集と読み取りを有効にする、パブリッシャー、アクセス、Visioおよびプロジェクト。
  • 新しいウィンドウではなく、同じウィンドウの新しいタブで複数のドキュメントを開いて作成します。
  • 生産性を 50% 向上させ、毎日何百回もマウス クリックを減らすことができます!
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.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations