Skip to main content

Conas bileoga oibre iolracha a chosaint ag an am céanna i Excel?

Ag glacadh leis go bhfuil leabhar oibre agat ina bhfuil bileoga oibre iolracha, agus anois ní mór duit na bileoga oibre go léir nó roinnt bileoga oibre ar leith a chosaint, de ghnáth i Excel, ní féidir leat ach an leathán a chosaint ceann ar cheann leis an bhfeidhm Bileog Cosain, ach tá an modh seo tedious agus am-íditheach má tá gá le bileoga iomadúla a chosaint. Conas a chosnaíonn tú leatháin iolracha ag an am céanna Excel tapa agus go héasca?

Cosain gach bileog ag an am céanna le cód VBA

Cosain leatháin iolracha ag an am céanna le Kutools for Excel

Díchosain leatháin iolracha ag an am céanna le kutools for Excel


mboilgeog cheart gorm saighead Cosain gach bileog ag an am céanna le cód VBA

Leis an gcód VBA seo a leanas, is féidir leat na bileoga uile den leabhar oibre gníomhach a chosaint ag an am céanna leis an pas céannaword, déan mar seo:

1. Coinnigh síos an ALT + F11 eochracha, agus osclaíonn sé an Microsoft Visual Basic d’Fheidhmchláir fhuinneog.

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

Cód VBA: Cosain gach bileog oibre i leabhar oibre ag an am céanna:

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. Ansin brúigh F5 eochair chun an cód a rith, agus an pas a ionchurword do na bileoga cosanta sa bhosca leid, féach an scáileán scáileáin:

doc-protect-multiple-sheet1-1

4. Cliceáil OK, agus ansin ionchur an pasword arís chun an pas a dhaingniúword.

doc-protect-multiple-sheet2-2

5. Ansin cliceáil OK, agus tá na bileoga go léir cosanta leis an pas céannaword.


mboilgeog cheart gorm saighead Cosain leatháin iolracha ag an am céanna le Kutools for Excel

Uaireanta, ní theastaíonn uait na bileoga go léir i do leabhar oibre a chosaint, agus níl uait ach roinnt bileoga ar leith a chosaint, sa chás seo, ní oibreoidh an cód thuas. Ach le Kutools for Excel'S Bileog Oibre a Chosaint fóntais, is féidir leat gach bileog agus bileog ar leith a chosaint go tapa agus go héasca.

Kutools for Excel : le níos mó ná 300 handy Excel breiseáin, saor chun triail a bhaint as gan aon teorainn i 60 lá

Tar éis a shuiteáil Kutools for Excel, déan na céimeanna seo a leanas le do thoil:

1. Cliceáil Kutools Níos mó > Bileog Oibre a Chosaint, féach ar an scáileán:

2. Sa an Bileog Oibre a Chosaint bosca dialóige, roghnaigh na bileoga a theastaíonn uait go gcosnófaí iad. (De réir réamhshocraithe, déantar na bileoga oibre go léir sa leabhar oibre reatha a sheiceáil.) Féach an scáileán:

doc-protect-multiple-sheet4-4

3. agus cliceáil OK, agus ansin cineál agus deimhnigh an pasword sa bhosca dialóg Cosain Bileog Oibre. Féach ar an scáileán:

doc-protect-multiple-sheet5-5

4. Ansin cliceáil OK, tá na bileoga oibre roghnaithe cosanta.

Cliceáil Cosain Bileog Oibre chun níos mó eolais a fháil ar an ngné seo.


mboilgeog cheart gorm saighead Díchosain leatháin iolracha ag an am céanna le kutools for Excel

Conas a d’fhéadfá roinnt bileoga oibre cosanta a chosaint i leabhar oibre ag an am céanna? Ar ndóigh, Kutools for Excel Soláthraíonn an Bileog Oibre Gan Chosaint fóntais duit gan iad a chosaint ag an am céanna.

Déan na céimeanna seo a leanas le do thoil:

1. Oscail do leabhar oibre ina bhfuil na bileoga oibre cosanta.

2. Ansin cliceáil Kutools Níos mó > Bileog Oibre Gan Chosaint, féach ar an scáileán:

3. Sa an Bileog Oibre Gan Chosaint bosca dialóige, liostáiltear na bileoga cosanta isteach sa bhosca liosta, ansin cliceáil Ok cnaipe, féach ar an scáileán:

doc-protect-multiple-sheet7-7

4. Agus ansin a Bileog Oibre Gan Chosaint Tagann an bosca dialóige amach chun an pas a chur i gcuimhne duitword atá cruthaithe agat chun na bileoga oibre a chosaint, féach an seat scáileáin:

doc-protect-multiple-sheet8-8

5. Tar éis an pas a chlóscríobhword, Cliceáil Ok, tá na bileoga oibre seiceáilte go léir sa bhosca liosta gan chosaint.

Nóta: Caithfidh an pas céanna a bheith ag na bileoga oibreword.

Chun níos mó eolais a fháil ar an ngné seo de Bhileog Oibre Gan chosaint.

Íoslódáil agus triail saor in aisce Kutools for Excel Anois!


mboilgeog cheart gorm saighead Taispeántas: Cosain nó Díchosain gach bileog oibre ag an am céanna le Kutools for Excel

Kutools for Excel: le níos mó ná 300 handy Excel breiseáin, saor chun triail a bhaint as gan aon teorainn i 30 lá. Íoslódáil agus triail saor in aisce Anois!

Airteagal gaolmhar:

Conas bileoga oibre iolracha a dhíchosaint ag an am céanna Excel?

Uirlisí Táirgiúlachta Oifige is Fearr

Oifig Tacaíochta/Excel 2007-2021 agus 365 | Ar fáil i 44 Teanga | Éasca le Díshuiteáil go hiomlán

Gnéithe Coitianta: Aimsigh/Aibhsigh/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 go Words, Comhshó Airgeadra,...)   |   7 Cumaisc & Scoilt uirlisí (Sraitheanna Comhcheangail Casta, Cealla Scoilt,...)   |   ... agus eile

Kutools for Excel Tá breis is 300 gné ann, A chinntiú nach bhfuil uait ach cliceáil ar shiúl...

Supercharge Do Excel scileanna: Éifeachtúlacht Taithí Mar Riamh Roimhe Le Kutools for Excel  (Triail Iomlán 30-Lá Saor in Aisce)

cluaisín kte 201905

Ráthaíocht Neamhchoinníollach Airgid Ar Ais 60-LáLeigh Nios mo... Íoslódáil saor in aisce ... Ceannach ... 

Office Tab Tugann sé comhéadan Tabbed chuig Oifig, agus Déan do chuid Oibre i bhfad níos éasca

  • Cumasaigh eagarthóireacht agus léamh tabáilte isteach Word, Excel, Pointe cumhachta, 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éaduithe ar do tháirgiúlacht faoi 50%, agus laghdaítear na céadta cad a tharlaíonn nuair luiche duit gach lá! (Triail Iomlán 30-Lá Saor in Aisce)
Ráthaíocht Neamhchoinníollach Airgid Ar Ais 60-LáLeigh Nios mo... Íoslódáil saor in aisce ... Ceannach ... 
 
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