Skip i'r prif gynnwys

Sut i amddiffyn fformatio celloedd ond dim ond caniatáu mewnbynnu data yn Excel?

Mewn llawer o achosion, efallai y bydd angen i chi amddiffyn fformatio ystod o gelloedd a chaniatáu mewnbynnu data yn Excel yn unig. Mae'r erthygl hon yn darparu tri dull i'w gyflawni.

Amddiffyn fformatio celloedd ond dim ond trwy ddiogelu taflen waith y dylid caniatáu mewnbynnu data
Amddiffyn fformatio celloedd ond dim ond caniatáu mewnbynnu data gyda chod VBA
Diogelu fformatio celloedd ond dim ond caniatáu mynediad data gyda Kutools ar gyfer Excel


Amddiffyn fformatio celloedd ond dim ond trwy ddiogelu taflen waith y dylid caniatáu mewnbynnu data

Ar gyfer amddiffyn fformatio celloedd ond dim ond caniatáu mewnbynnu data, mae angen i chi ddatgloi'r celloedd hyn yn gyntaf, ac yna amddiffyn y daflen waith. Gwnewch fel a ganlyn.

1. Dewiswch y celloedd sydd eu hangen arnoch i amddiffyn eu fformatio ond dim ond caniatáu mewnbynnu data, yna pwyswch Ctrl + 1 allweddi ar yr un pryd i agor y Celloedd Fformat blwch deialog.

2. Yn y Celloedd Fformat blwch deialog, dad-diciwch y Dan glo blwch o dan y Diogelu tab, ac yna cliciwch ar y OK botwm. Gweler y screenshot:

3. Nawr ewch i glicio adolygiad > Diogelu Dalen.

4. Nodwch a chydymffurfiwch â'ch cyfrinair yn y Diogelu Dalen ac cadarnhau Cyfrinair blychau deialog. Gweler y screenshot:

Nawr mae'r daflen waith wedi'i gwarchod, ac nid yw'r fformatio celloedd yn cael ei newid. Ond caniateir mewnbynnu data yn unig i'r celloedd penodedig.


Amddiffyn fformatio celloedd ond dim ond caniatáu mewnbynnu data gyda chod VBA

Gallwch hefyd redeg y sgript VBA ganlynol i amddiffyn fformatio celloedd ond dim ond caniatáu mewnbynnu data yn Excel. Gwnewch fel a ganlyn.

1. Gwasgwch Alt + F11 allweddi ar yr un pryd i agor y Microsoft Visual Basic ar gyfer Ceisiadau ffenestr.

2. Yn y Microsoft Visual Basic ar gyfer Ceisiadau ffenestr, cliciwch ddwywaith Llyfr Gwaith hwn ar y cwarel Prosiect, ac yna copïwch a gludwch y cod VBA isod i'r Y Llyfr Gwaith hwn (Cod) ffenestr.

Cod VBA: Amddiffyn fformatio celloedd ond dim ond caniatáu mewnbynnu data

Sub AllowDataEntryOnly()
    ActiveSheet.Protect Userinterfaceonly:=True, AllowFiltering:=True
    Range("C2:C20").Locked = False
        MsgBox "Only allow data entry in range C2:C20", vbInformation, "Kutools for Excel"
End Sub

Nodyn: Yn y cod, C2: C20 yw'r amrediad y mae'r celloedd rydych chi'n caniatáu mewnbynnu data yn unig. Newidiwch yr ystod yn seiliedig ar eich anghenion.

3. Gwasgwch y F5 allwedd i redeg y cod. Mewn popping i fyny Kutools ar gyfer Excel blwch deialog, cliciwch ar y OK botwm.

Nawr mae'r daflen waith wedi'i gwarchod yn ogystal â fformatio'r celloedd. A dim ond y celloedd penodedig sy'n cael mewnbynnu data.


Diogelu fformatio celloedd ond dim ond caniatáu mynediad data gyda Kutools ar gyfer Excel

Gallwch chi ddatgloi celloedd dethol yn hawdd a diogelu taflen waith gyda'r Dylunio Taflen Waith cyfleustodau o Kutools ar gyfer Excel .

Cyn gwneud cais Kutools ar gyfer Excel, os gwelwch yn dda ei lawrlwytho a'i osod yn gyntaf.

1. Cliciwch Kutools Byd Gwaith > Dylunio Taflen Waith i actifadu'r dylunio tab.

2. Dewiswch y celloedd sydd eu hangen arnoch i amddiffyn eu fformatio ond dim ond caniatáu mewnbynnu data, cliciwch Datgloi Celloedd O dan y dylunio tab, ac yna cliciwch ar y OK botwm yn y popping up Kutools ar gyfer Excel blwch deialog. Gweler y screenshot:

3. Cliciwch ar y Diogelu Dalen botwm o dan y dylunio tab.

4. Ac yna nodwch a chydymffurfiwch â'ch cyfrinair yn y Diogelu Dalen ac cadarnhau Cyfrinair blychau deialog. Gweler y screenshot:

Nawr mae'r daflen waith wedi'i gwarchod. A chaniateir mewnbynnu data yn unig i'r celloedd penodedig.

  Os ydych chi am gael treial am ddim (30 diwrnod) o'r cyfleustodau hwn, cliciwch i'w lawrlwytho, ac yna ewch i gymhwyso'r llawdriniaeth yn ôl y camau uchod.


Erthygl gysylltiedig:

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 (16)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Cette manœuvre ne fonctionne pas. Les formules ne sont toujours pas sécurisées
This comment was minimized by the moderator on the site
Tried that and save, after I close file, it asks for password. Which of course there is none and I am now locked out of my workbook. Pls adv
This comment was minimized by the moderator on the site
Hi Pamela,
If you apply the VBA code mentioned in the post. The worksheet is protected, but there is no password. Please click Review > Unprotect Worksheet to unprotect the worksheet without entering a password.
This comment was minimized by the moderator on the site
I read the "Protect cell formatting but only allow data entry by protecting worksheet" is wrong. The format can still be changed. I thought you had found something there. You did not...
This comment was minimized by the moderator on the site
Yeah.. this does not work at all. It does not prevent the cells from being formatted. Bad site!
This comment was minimized by the moderator on the site
Hi, Thank you for the code, it was very useful. I was wondering if you could put in a part where the supervisor could enter a code so that they could edit the formatting and then locking it again without having to delete the code every time this is needed.
This comment was minimized by the moderator on the site
I followed the directions, but was not able to enter data into the locked cells as mentioned in the instructions. Anyone have a solution?
This comment was minimized by the moderator on the site
Hi kristen,
For a protected worksheet, you can only enter data into the unlocked cells.
This comment was minimized by the moderator on the site
It still allows for users to delete the formulas...
This comment was minimized by the moderator on the site
It is any way that you can lock the cells for the formulas and allow input data only? With regular excel not having enterprise
This comment was minimized by the moderator on the site
The "Protecting Worksheet" instructions do not lock the formatting. If you copy cells in normally the formatting is copied over with them.
This comment was minimized by the moderator on the site
Please let us know if found a solution for this specific case.
This comment was minimized by the moderator on the site
The solution is here, however it is very medicore because You may forget about ctrl + z :P Useless if You want to preapare worksheet for others but usefull for own purposes if set as "ctrl + shift + v"

https://www.extendoffice.com/documents/excel/2545-excel-set-paste-values-as-default.html
This comment was minimized by the moderator on the site
agreed.... did you find any other solution to this anywhere?
This comment was minimized by the moderator on the site
Came here looking for a solution to this same problem which Matt mentioned.
If you paste a cell from another sheet to the protected cell, unfortunately cell formatting is overwritten!
Any solution to this issue so far?
This comment was minimized by the moderator on the site
I am having the same. The whole reason I want to protect the formatting is to stop the copy & paste issue! I hope someone has a solution.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations