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

Excelですべてのチェックボックスを一度にオフまたは選択解除するにはどうすればよいですか?

次のスクリーンショットに示すように、ワークシートで一度にすべてのチェックボックスをオフまたは選択解除するにはどうすればよいですか? この記事では、それを解決するためのいくつかの簡単なコードについて説明します。

docチェックボックスのチェックを外す1

VBAコードでチェックされているすべてのチェックボックスをオフまたは選択解除します


矢印青い右バブル VBAコードでチェックされているすべてのチェックボックスをオフまたは選択解除します

チェックされているすべてのチェックボックス(フォームコントロール)のチェックを外すか、選択を解除します。

チェックボックスがフォームコントロールの場合は、次のVBAコードを使用して一度にチェックを外すことができます。

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

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

VBAコード:チェックされているすべてのチェックボックス(フォームコントロール)のチェックを外すか、選択を解除します。

Sub ClearCheckBoxes()
'Updateby Extendoffice
    Dim chkBox As Excel.CheckBox
    Application.ScreenUpdating = False
    For Each chkBox In ActiveSheet.CheckBoxes
            chkBox.Value = xlOff
    Next chkBox
    Application.ScreenUpdating = True
End Sub

3。 次に、 F5 このコードを実行するにはキーを押します。アクティブなワークシートでは、チェックされているすべてのチェックボックスが一度にオフになっています。


チェックされているすべてのチェックボックス(ActiveXコントロール)のチェックを外すか、選択を解除します。

チェックボックスがActiveXコントロールの場合は、以下のVBAコードを適用してください。

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

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

VBAコード:チェックされているすべてのチェックボックス(ActiveXコントロール)のチェックを外すか、選択を解除します。

Sub clearcheckbox()
'Updateby Extendoffcie
    Dim c As Object
    For Each c In ActiveSheet.OLEObjects
        If InStr(1, c.Name, "CheckBox") > 0 Then
            c.Object.Value = False
        End If
    Next
End Sub

3。 次に、 F5 このコードを実行するにはキーを押します。アクティブなワークシートでは、チェックされているすべてのチェックボックスが一度に選択解除されています。


選択範囲に一度に複数のチェックボックスを挿入します

Kutools for Excel's バッチ挿入チェックボックス ユーティリティを使用すると、一度に複数のチェックボックスをすばやく挿入できます。 クリックしてKutoolsfor 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 (15)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi!!

Thank you very much, all the codes work very well, it has been extremely useful to me, extraordinary work!

Kind regards
This comment was minimized by the moderator on the site
How would I clear all checkboxes on all worksheets?
This comment was minimized by the moderator on the site
How would clear all checkboxes on all worksheets?
This comment was minimized by the moderator on the site
Hello, Ramon

To clear all the checkboxes accross all sheets, please apply the below codes:
Uncheck all checkboxes from all sheets (Form Controls):
Sub Uncheckallcheckboxes()
    Dim sh As Worksheet
    For Each sh In Sheets
        On Error Resume Next
            sh.CheckBoxes.Value = False
        On Error GoTo 0
    Next sh
End Sub


Uncheck all checkboxes from all sheets (ActiveX Controls):
Sub uncheck_all_ActiveX_checkboxes()
    Dim ws As Worksheet
    Dim xbox As OLEObject
    For Each ws In ThisWorkbook.Worksheets
        For Each xbox In ws.OLEObjects
            ws.OLEObjects(xbox.Name).Object.Value = False
        Next
    Next
End Sub


Please have a try, hope this can help you!
This comment was minimized by the moderator on the site
Hallo,
beim öffnen der datei sollten zwei voneinander abhängige CheckBox1 u. CheckBox2 nicht aktiviert sein

Private Sub CheckBox2_Click()
If CheckBox2 = True Then
CheckBox1 = False
End If
End Sub
Private Sub CheckBox1_Click()
If CheckBox1 = True Then
CheckBox2 = False
End If
End Sub

Danke für eure Hilfe
This comment was minimized by the moderator on the site
Hello, Siegfried
If you want to check one and disable another one, please apply the below code:
Note: The checkbox here you should use the ActiveX Control checkbox.
Private Sub CheckBox2_Click()
If CheckBox2 = True Then
CheckBox1.Enabled = False
Else
CheckBox1.Enabled = True
End If
End Sub
Private Sub CheckBox1_Click()
If CheckBox1 = True Then
CheckBox2.Enabled = False
Else
CheckBox2.Enabled = True
End If
End Sub

Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
Merci beaucoup d'avoir partagé le code pour décocher des éléments "CheckBox", cela m'a sauvé ! :o)En effet, en codant un formulaire de saisie fait dans une feuille, je cherchais à trouver un moyen de décocher les cases (en guise de réinitialisation du formulaire) et je ne trouvais pas (à part avec la méthode "Select" qui est, comme nous le savons tous, à bannir), tout simplement car :=> la propriété ".CheckBoxes" n'existe pas en propriété d'une "Worksheet" !=> l'Objet "CheckBoxes" ne figure pas non plus dans l'explorateur d'objets !C'est lunaire cette histoire...Alors merci énormément.Bien à vous.
This comment was minimized by the moderator on the site
Bonjour Lindas,
Je vous en prie. Heureux que cela aide. Pour toute question, n'hésitez pas à nous contacter. Passe une bonne journée.
Sincèrement,
Mandy
This comment was minimized by the moderator on the site
OMG THANK YOU, THIS WEBSITE IS A LIFE SAVER :)
This comment was minimized by the moderator on the site
Big help! thank you!
This comment was minimized by the moderator on the site
How do i uncheck only the boxes in a specific cell range in the active sheet? I have 3 lists in one sheet (Daily/Weekly/Monthly tasks) and wanted to make a "Clear All" button for each list.
This comment was minimized by the moderator on the site
What if I wanted to use a button to activate the macro to clear the boxes?
This comment was minimized by the moderator on the site
Hi, Ariel,
To use a button to activate the macro, first, you should insert a button from the Shapes drop down list, and then right click the button, choose Assign Macro from the context menu, and then select the macro name in the Assign Macro dialog box. Then click OK, and the macro code will be linked to the button.
Please try, hope it can help you!
This comment was minimized by the moderator on the site
many thanks for this vba code, helped greatly.

FYI for people not getting it to work by hitting F5, simply :

developer tab > macros > select the module just created and click options > type a character for the shortcut, such as ctrl+j or ctrl+k.
This comment was minimized by the moderator on the site
Thanks for your help with this. It is much appreciated. However please note: THE SPELLING IS WRONG IN THE CODE FOR STEP #2. VBA code: Uncheck or deselect all checked checkboxes (ActiveX Controls):
Sub clearcheckbox()
'Updateby Extendoffcie
Dim c As Object
For Each c In ActiveSheet.OLEObjects
If InStr(1, c.Name, "CheckBox") > 0 Then
c.Object.Value = False
End If
Next
End Sub

PLEASE NOTE THE WORD "Extendoffcie" IS NOT SPELLED CORRECTLY. SHOULDN'T IT BE "Extendoffice"?? Anyway, just wanted to put that out there
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations