Skip i'r prif gynnwys

Sut i atal taflen waith benodol rhag cael ei dileu yn Excel?

Os ydych chi am atal taflen waith benodol rhag cael ei dileu yn Excel, rhowch gynnig ar y dull yn yr erthygl hon.

Atal taflen waith benodol rhag cael ei dileu gyda chod VBA


Atal taflen waith benodol rhag cael ei dileu gyda chod VBA

Gall y cod VBA isod eich helpu i atal taflen waith benodol rhag cael ei dileu yn Excel. Gwnewch fel a ganlyn.

1. Agorwch y daflen waith nad ydych chi am iddi gael ei dileu, cliciwch ar y dde ar y tab dalen a chlicio Gweld y Cod o'r ddewislen clicio ar y dde.

2. Yn y Microsoft Visual Basic ar gyfer Ceisiadau ffenestr, copïwch a gludwch y cod VBA isod i mewn i ffenestr y Cod.

Cod VBA: Atal taflen waith benodol rhag cael ei dileu yn Excel

Private Sub Worksheet_Activate()
ThisWorkbook.Protect "yourpassword"
End Sub

Private Sub Worksheet_Deactivate()
ThisWorkbook.Unprotect "yourpassword"
End Sub

Nodyn: Yn y cod, rhowch eich cyfrinair go iawn yn lle'r cynnwys “yourpassword”.

3. Gwasgwch y Alt + Q allweddi ar yr un pryd i gau'r Microsoft Visual Basic ar gyfer Ceisiadau ffenestr.

4. Symud i daflen waith arall ac ewch yn ôl i'r daflen waith hon eto i actifadu'r cod VBA.

5. De-gliciwch y tab dalen, gallwch weld y Dileu mae'r opsiwn yn llwyd ac yn anabl ymhlith yr opsiynau fel y dangosir isod.


Erthyglau perthnasol:

Offer Cynhyrchiant Swyddfa Gorau

🤖 Kutools AI Aide: Chwyldro dadansoddi data yn seiliedig ar: Cyflawniad Deallus   |  Cynhyrchu Cod  |  Creu Fformiwlâu Personol  |  Dadansoddi Data a Chynhyrchu Siartiau  |  Invoke Swyddogaethau Kutools...
Nodweddion Poblogaidd: Darganfod, Amlygu neu Adnabod Dyblygiadau   |  Dileu Rhesi Gwag   |  Cyfuno Colofnau neu Gelloedd heb Colli Data   |   Rownd heb Fformiwla ...
Super-edrych: VLookup Meini Prawf Lluosog    VLookup Gwerth Lluosog  |   VLookup Ar Draws Taflenni Lluosog   |   Edrych Niwlog ....
Rhestr gwympo Uwch: Creu Rhestr Gollwng yn Gyflym   |  Rhestr Gollwng Dibynnol   |  Rhestr Gollwng Aml-ddewis ....
Rheolwr Colofn: Ychwanegu Nifer Penodol o Golofnau  |  Symud Colofnau  |  Toglo Statws Gwelededd Colofnau Cudd  |  Cymharwch Ystodau a Cholofnau ...
Nodweddion dan Sylw: Ffocws ar y Grid   |  Golwg Dylunio   |   Bar Fformiwla Mawr    Rheolwr Llyfr Gwaith a Thaflen   |  Llyfrgell Adnoddau (Testun Auto)   |  Dewiswr Dyddiad   |  Cyfuno Taflenni Gwaith   |  Amgryptio/Dadgryptio Celloedd    Anfon E-byst trwy Restr   |  Hidlo Super   |   Hidlo Arbennig (hidlo mewn print trwm/italig/strikethrough...) ...
15 Set Offer Gorau12 Testun offer (Ychwanegu Testun, Dileu Cymeriadau,...)   |   50 + Siart Mathau (Siart Gantt,...)   |   40+ Ymarferol Fformiwlâu (Cyfrifwch oedran yn seiliedig ar ben-blwydd,...)   |   19 mewnosod offer (Mewnosod Cod QR, Mewnosod Llun o'r Llwybr,...)   |   12 Trosi offer (Rhifau i Eiriau, Trosi arian cyfred,...)   |   7 Uno a Hollti offer (Rhesi Cyfuno Uwch, Celloedd Hollt,...)   |   ... a mwy

Supercharge Eich Sgiliau Excel gyda Kutools ar gyfer Excel, a Phrofiad Effeithlonrwydd Fel Erioed Erioed. Kutools ar gyfer Excel Yn Cynnig Dros 300 o Nodweddion Uwch i Hybu Cynhyrchiant ac Arbed Amser.  Cliciwch Yma i Gael Y Nodwedd Sydd Ei Angen Y Mwyaf...

Disgrifiad


Mae Office Tab yn dod â rhyngwyneb Tabbed i Office, ac yn Gwneud Eich Gwaith yn Haws o lawer

  • Galluogi golygu a darllen tabbed yn Word, Excel, PowerPoint, Cyhoeddwr, Mynediad, Visio a Phrosiect.
  • Agor a chreu dogfennau lluosog mewn tabiau newydd o'r un ffenestr, yn hytrach nag mewn ffenestri newydd.
  • Yn cynyddu eich cynhyrchiant 50%, ac yn lleihau cannoedd o gliciau llygoden i chi bob dydd!
Comments (6)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
C'est très bien, mais ma macro ne marche pas depuis que j'ai ajouter cette protection. Pourtant j'ai bien une formule pour deverrouiller mes pages lors du lancement de la macro. Comment faire?
This comment was minimized by the moderator on the site
Здравствуйте. Вы пишите " 3. нажмите другой + Q клавиши одновременно, чтобы закрыть Microsoft Visual Basic для приложений окно. "

а что такое " другой +Q" ?
This comment was minimized by the moderator on the site
Hi Владимир,
Alt + Q is the default keyboard shortcuts to close the Visual Basic Editor window and returns to application.
This comment was minimized by the moderator on the site
hmm.. but after you do that everyone can still click on "view code" and see the password. what is the password for? how can you delete the sheet using the password?
This comment was minimized by the moderator on the site
Mate.., it is more for ACCIDENTAL DELETION.
This comment was minimized by the moderator on the site
This does not prevent worksheet deletion. Add an extra sheet, select the new sheet as the primary, the "protected" sheet as a secondary selection and delete. Bye-bye "protected" sheet.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations