Skip to main content

Conas bosca seiceála a úsáid chun bileog oibre in Excel a cheilt nó a cheilt.

Is gné úsáideach é an ticbhosca in Excel. Taispeánfaidh mé duit anseo conas bosca seiceála a úsáid chun bileog oibre sonraithe in Excel a cheilt nó a chur ar neamhní.

Úsáid bosca seiceála chun an bhileog oibre in Excel a cheilt nó a cheilt


Úsáid bosca seiceála chun an bhileog oibre in Excel a cheilt nó a cheilt

Má tá bosca seiceála darb ainm bosca seiceála1 agat i do leabhar oibre. Agus an ticbhosca seo á dísheiceáil agat, teastaíonn uait bileog oibre áirithe a chur i bhfolach go huathoibríoch sa leabhar oibre seo, agus an bhileog oibre seo a chur ar neamhní agus an ticbhosca á seiceáil. Bain amach é mar a leanas.

1. Oscail an bhileog oibre tá an ticbhosca1, cliceáil ar dheis ar an táb bileog, agus ansin cliceáil Féach an cód ón roghchlár cliceáil ar dheis.

nótaí: Ba chóir go mbeadh an bosca seiceála mar bhosca seiceála ActiveX agus tú ag cur isteach.

2. Sa Microsoft Visual Basic d’Fheidhmchláir fuinneog, cóipeáil agus greamaigh an cód VBA thíos i bhfuinneog an Chóid. Féach an pictiúr:

Cód VBA: Úsáid bosca seiceála chun bileog oibre shonraithe a cheilt nó a cheilt

Private Sub CheckBox1_Click()
    On Error Resume Next
    ThisWorkbook.Sheets("Sheet5").Visible = CheckBox1.Value
End Sub

nótaí: Sa chód, Bileog5 is ainm don bhileog oibre a cheiltfidh tú nó a chuirfidh tú i bhfolach le bosca seiceála1. Cuir ainm na bileoige oibre de réir mar is gá duit.

3. Brúigh Eile + Q eochracha ag an am céanna chun an Microsoft Visual Basic d’Fheidhmchláir fhuinneog.

As seo amach, agus an ticbhosca1 á seiceáil, cuirfear an bhileog oibre shonraithe “Bileog5” i bhfolach go huathoibríoch. Agus is féidir leat é a thaispeáint tríd an mbosca seiceála a sheiceáil. Féach an pictiúr:


Earraí gaolmhara:

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 (11)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Bonjour,
Je cherche à afficher des pages avec des cases à cocher. Les Chekbox sont toutes sur la même feuille de calcul.
J'ai copié le premier code et l'ai dupliquer.

Private Sub CheckBox1_Click()
On Error Resume Next
ThisWorkbook.Sheets("Eplucher, laver, désinfecter").Visible = CheckBox1.Value
End Sub

Private Sub CheckBox2_Click()
On Error Resume Next
ThisWorkbook.Sheets("Tailler fruits et légumes").Visible = CheckBox1.Value
End Sub

Malheureusement, si je ne coche pas la première case ma seconde case ne fonctionne pas. Pourriez-vous m'aider svp
This comment was minimized by the moderator on the site
Hi Sky53,
I seems that you did not change CheckBox1.Value to the corresponding checkbox name in the second VBA code.
Please change the following line in the second code:
ThisWorkbook.Sheets("Tailler fruits et légumes").Visible = CheckBox1.Value
to
ThisWorkbook.Sheets("Tailler fruits et légumes").Visible = CheckBox2.Value
This comment was minimized by the moderator on the site
Hi Crystal,
Is there a function that would reverse this; ie. sheet is hidden unless checkbox is ticked?
This comment was minimized by the moderator on the site
Hi. I'm very new to ActiveX Controls. I am trying to have multiple checkboxes on one sheet that will hide specific sheets and not all of them or the same one every time. These two scenarios have been my experience. What I need to accomplish is:
CheckBox1 hides Sheet2
CheckBox2 hides Sheet3
CheckBox3 hides Sheet4
CheckBox4 hides Sheet5
CheckBox5 hides Sheet6
CheckBox6 hides Sheet7
CheckBox7 hides Sheet8
CheckBox8 hides Sheet9
This comment was minimized by the moderator on the site
Hi Jack,
Just repeat the code and change the checkbox numbers and the sheet names. Try the below code.

Private Sub CheckBox1_Click()

On Error Resume Next

ThisWorkbook.Sheets("Sheet2").Visible = CheckBox1.Value

End Sub

Private Sub CheckBox2_Click()

On Error Resume Next

ThisWorkbook.Sheets("Sheet3").Visible = CheckBox2.Value

End Sub

Private Sub CheckBox3_Click()

On Error Resume Next

ThisWorkbook.Sheets("Sheet4").Visible = CheckBox3.Value

End Sub

Private Sub CheckBox4_Click()

On Error Resume Next

ThisWorkbook.Sheets("Sheet5").Visible = CheckBox4.Value

End Sub

Private Sub CheckBox5_Click()

On Error Resume Next

ThisWorkbook.Sheets("Sheet6").Visible = CheckBox5.Value

End Sub

Private Sub CheckBox6_Click()

On Error Resume Next

ThisWorkbook.Sheets("Sheet7").Visible = CheckBox6.Value

End Sub

Private Sub CheckBox7_Click()

On Error Resume Next

ThisWorkbook.Sheets("Sheet8").Visible = CheckBox7.Value

End Sub

Private Sub CheckBox8_Click()

On Error Resume Next

ThisWorkbook.Sheets("Sheet9").Visible = CheckBox8.Value

End Sub
This comment was minimized by the moderator on the site
Crystal,
Thanks so much...it worked perfectly!
This comment was minimized by the moderator on the site
How do I hide or unhide a sheet with multiple checkbox? For example sheet "MainMenu" need to be hide unless checkbox_1, checkbox_2 & checkbox_3 are checked.
This comment was minimized by the moderator on the site
Funciona perfectamente pero, ¿cómo se pueden ocultar varias hojas con el mismo checkbox? Muchas gracias!
This comment was minimized by the moderator on the site
Basta con copiar la linea tantas veces como se quiera nombrando la hoja que debe ser ocultada.

Private Sub CheckBox1_Click()
On Error Resume Next
ThisWorkbook.Sheets("DB2018").Visible = CheckBox1.Value
ThisWorkbook.Sheets("V2018").Visible = CheckBox1.Value
ThisWorkbook.Sheets("R2018").Visible = CheckBox1.Value
End Sub
This comment was minimized by the moderator on the site
How do you do multiple on the same page? How do i then hide sheet 3 or 4 with a checkbox?
This comment was minimized by the moderator on the site
Private Sub CheckBox1_Click()
On Error Resume Next
ThisWorkbook.Sheets("DB2018").Visible = CheckBox1.Value
ThisWorkbook.Sheets("V2018").Visible = CheckBox1.Value
ThisWorkbook.Sheets("R2018").Visible = CheckBox1.Value
End Sub
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations