Skip to main content

Conas gach bosca seiceála a dhísheiceáil nó a dhí-roghnú ag an am céanna in Excel?

Conas a d’fhéadfá na boscaí seiceála go léir a sheiceáil nó a dhí-roghnú ag an am céanna i mbileog oibre mar a thaispeántar an pictiúr a leanas? San Airteagal seo, labhróidh mé faoi roinnt cóid thapa chun é a réiteach.

boscaí seiceála doc uncheck 1

Díthiceáil nó díroghnaigh gach bosca seiceála le cód VBA


mboilgeog cheart gorm saighead Díthiceáil nó díroghnaigh gach bosca seiceála le cód VBA

Díthiceáil nó díroghnaigh gach bosca seiceála seiceáilte (Rialuithe Foirme):

Más rialuithe foirme iad do bhosca seiceála, is féidir leat iad a dhísheiceáil ag an am céanna leis an gcód VBA seo a leanas:

1. Coinnigh síos an ALT + F11 eochracha a oscailt Microsoft Visual Basic d’Fheidhmchláir fhuinneog.

2. Cliceáil Ionsáigh > Modúil, agus greamaigh an cód seo a leanas sa Modúil Fuinneog.

Cód VBA: Díthiceáil nó díroghnaigh gach bosca seiceála seiceáilte (Rialuithe Foirme):

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. Ansin brúigh F5 eochair chun an cód seo a rith, agus dísheiceáladh gach bosca seiceála seiceáilte ag an am céanna sa bhileog oibre gníomhach.


Díthiceáil nó díroghnaigh gach bosca seiceála seiceáilte (Rialuithe ActiveX):

Más Rialuithe ActiveX iad na boscaí seiceála, cuir an cód VBA thíos i bhfeidhm:

1. Coinnigh síos an ALT + F11 eochracha a oscailt Microsoft Visual Basic d’Fheidhmchláir fhuinneog.

2. Cliceáil Ionsáigh > Modúil, agus greamaigh an cód seo a leanas sa Modúil Fuinneog.

Cód VBA: Díthiceáil nó díroghnaigh gach bosca seiceála seiceáilte (Rialuithe 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. Ansin brúigh F5 eochair chun an cód seo a rith, agus rinneadh gach bosca seiceála a dhí-roghnú ag an mbileog oibre gníomhach ag an am céanna.


Cuir boscaí seiceála iolracha isteach i roghnúcháin ag an am céanna

Kutools le haghaidh Excel's Boscaí Seiceála Iontrála Baisc is féidir le fóntais cabhrú leat ilbhoscaí a chur isteach go tapa ag an am céanna. Cliceáil chun Kutools a íoslódáil le haghaidh Excel!

Uirlisí Táirgiúlachta Oifige is Fearr

🤖 Kutools AI Aide: anailís sonraí a réabhlóidiú bunaithe ar: Forghníomhú Chliste   |  Gin Cód  |  Cruthaigh Foirmlí Saincheaptha  |  Anailís a dhéanamh ar Sonraí agus Cairteacha a Ghin  |  Feidhmeanna Kutools a agairt...
Gnéithe Coitianta: Faigh, Aibhsigh nó Aithnigh Dúblaigh   |  Scrios Sraitheanna Bána   |  Comhcheangail Colúin nó Cealla gan Sonraí a Chailleadh   |   Babhta gan Foirmle ...
Cuardaigh Super: Ilchritéir VLookup    VLookup Illuachanna  |   VLookup Trasna Ilbhileoga   |   Amharc doiléir ....
Liosta anuas Casta: Go tapa Cruthaigh Liosta Anuas   |  Liosta anuas Cleithiúnach   |  Liosta Buail Isteach Ilroghnacha ....
Bainisteoir Colún: Cuir Líon Sonrach Colún leis  |  Colúin Bog  |  Scoránaigh Stádas Infheictheachta na gColún Ceilte  |  Déan comparáid idir Raonta & Colúin ...
Gnéithe Réadmhaoin: Fócas Eangaí   |  Amharc Dearaidh   |   Barra Mór na Foirmle    Leabhar Oibre & Bainisteoir Bileog   |  Leabharlann Acmhainní (Uaththéacs)   |  Piocálaí Dáta   |  Comhcheangail Bileoga Oibre   |  Criptigh/Díchriptigh Cealla    Seol Ríomhphost trí Liosta   |  Scagaire Super   |   Scagaire Speisialta (scagaire trom/iodálach/stailc tríd...) ...
Barr 15 Uirlisí12 Téacs uirlisí (Cuir Téacs, Bain Carachtair,...)   |   50 + Cairt cineálacha (Cairt Gantt,...)   |   40+ Praiticiúil Foirmlí (Ríomh aois bunaithe ar lá breithe,...)   |   19 Insertion uirlisí (Cuir isteach Cód QR, Ionsáigh Pictiúr ón gCosán,...)   |   12 Tiontú uirlisí (Uimhreacha le Focail, Comhshó Airgeadra,...)   |   7 Cumaisc & Scoilt uirlisí (Sraitheanna Comhcheangail Casta, Cealla Scoilt,...)   |   ... agus eile

Supercharge Do Scileanna Excel le Kutools le haghaidh Excel, agus Éifeachtúlacht Taithí Cosúil Ná Roimhe. Kutools le haghaidh Excel Tairiscintí Níos mó ná 300 Ardghnéithe chun Táirgiúlacht a Treisiú agus Sábháil Am.  Cliceáil anseo chun an ghné is mó a theastaíonn uait a fháil ...

Tuairisc


Tugann Tab Oifige comhéadan Tabbed chuig Office, agus Déan Do Obair i bhfad Níos Éasca

  • Cumasaigh eagarthóireacht agus léamh tabbed i Word, Excel, PowerPoint, Foilsitheoir, Rochtain, Visio agus Tionscadal.
  • Oscail agus cruthaigh cáipéisí iolracha i gcluaisíní nua den fhuinneog chéanna, seachas i bhfuinneoga nua.
  • Méadaíonn do tháirgiúlacht 50%, agus laghdaíonn sé na céadta cad a tharlaíonn nuair luch duit gach lá!
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