ไปยังเนื้อหาหลัก

วิธีป้องกันการจัดรูปแบบเซลล์ แต่อนุญาตให้ป้อนข้อมูลใน Excel เท่านั้น

ในหลาย ๆ กรณีคุณอาจต้องป้องกันการจัดรูปแบบของช่วงของเซลล์และอนุญาตให้ป้อนข้อมูลใน Excel เท่านั้น บทความนี้มีสามวิธีในการบรรลุเป้าหมาย

ป้องกันการจัดรูปแบบเซลล์ แต่อนุญาตให้ป้อนข้อมูลโดยการปกป้องแผ่นงานเท่านั้น
ป้องกันการจัดรูปแบบเซลล์ แต่อนุญาตให้ป้อนข้อมูลด้วยรหัส VBA เท่านั้น
ป้องกันการจัดรูปแบบเซลล์ แต่อนุญาตให้ป้อนข้อมูลด้วย Kutools for Excel เท่านั้น


ป้องกันการจัดรูปแบบเซลล์ แต่อนุญาตให้ป้อนข้อมูลโดยการปกป้องแผ่นงานเท่านั้น

สำหรับการป้องกันการจัดรูปแบบเซลล์ แต่อนุญาตให้ป้อนข้อมูลเท่านั้นคุณต้องปลดล็อกเซลล์เหล่านี้ก่อนจากนั้นจึงป้องกันแผ่นงาน กรุณาดำเนินการดังนี้

1. เลือกเซลล์ที่คุณต้องการป้องกันการจัดรูปแบบ แต่อนุญาตให้ป้อนข้อมูลเท่านั้นจากนั้นกด Ctrl + 1 พร้อมกันเพื่อเปิดไฟล์ จัดรูปแบบเซลล์ กล่องโต้ตอบ

2 ใน จัดรูปแบบเซลล์ กล่องโต้ตอบยกเลิกการเลือก ล็อค ภายใต้ การป้องกัน จากนั้นคลิกแท็บ OK ปุ่ม. ดูภาพหน้าจอ:

3. ตอนนี้ไปที่คลิก รีวิว > ป้องกันแผ่นงาน.

4. โปรดระบุและปฏิบัติตามรหัสผ่านของคุณในไฟล์ ป้องกันแผ่นงาน และ ยืนยันรหัสผ่าน กล่องโต้ตอบ ดูภาพหน้าจอ:

ตอนนี้แผ่นงานได้รับการป้องกันแล้วและการจัดรูปแบบเซลล์จะไม่เปลี่ยนแปลง แต่เซลล์ที่ระบุจะได้รับอนุญาตให้ป้อนข้อมูลเท่านั้น


ป้องกันการจัดรูปแบบเซลล์ แต่อนุญาตให้ป้อนข้อมูลด้วยรหัส VBA เท่านั้น

คุณยังสามารถเรียกใช้สคริปต์ VBA ต่อไปนี้เพื่อป้องกันการจัดรูปแบบเซลล์ แต่อนุญาตให้ป้อนข้อมูลใน Excel เท่านั้น กรุณาดำเนินการดังนี้

1 กด อื่น ๆ + F11 ในเวลาเดียวกันเพื่อเปิดไฟล์ Microsoft Visual Basic สำหรับแอปพลิเคชัน หน้าต่าง

2 ใน Microsoft Visual Basic สำหรับแอปพลิเคชัน ดับเบิลคลิก สมุดงานนี้ บนบานหน้าต่างโครงการจากนั้นคัดลอกและวางรหัส VBA ด้านล่างลงในไฟล์ ThisWorkbook (รหัส) หน้าต่าง

รหัส VBA: ป้องกันการจัดรูปแบบเซลล์ แต่อนุญาตให้ป้อนข้อมูลเท่านั้น

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

หมายเหตุ: ในรหัส C2: C20 คือช่วงที่เซลล์ที่คุณอนุญาตให้ป้อนข้อมูล โปรดเปลี่ยนช่วงตามความต้องการของคุณ

3 กด F5 กุญแจสำคัญในการเรียกใช้รหัส ในกล่องโต้ตอบ Kutools for Excel ที่โผล่ขึ้นมาให้คลิกปุ่มตกลง

ตอนนี้แผ่นงานได้รับการป้องกันเช่นเดียวกับการจัดรูปแบบเซลล์ และเฉพาะเซลล์ที่ระบุเท่านั้นที่ได้รับอนุญาตให้ป้อนข้อมูล


ป้องกันการจัดรูปแบบเซลล์ แต่อนุญาตให้ป้อนข้อมูลด้วย Kutools for Excel เท่านั้น

คุณสามารถปลดล็อกเซลล์ที่เลือกและปกป้องแผ่นงานได้อย่างง่ายดายด้วยยูทิลิตี้การออกแบบแผ่นงานของ Kutools for Excel

ก่อนที่จะใช้ Kutools สำหรับ Excelโปรด ดาวน์โหลดและติดตั้งในตอนแรก.

1 คลิก Kutools พลัส > การออกแบบแผ่นงาน เพื่อเปิดใช้งานไฟล์ ออกแบบ แถบ

2. เลือกเซลล์ที่คุณต้องการป้องกันการจัดรูปแบบ แต่อนุญาตให้ป้อนข้อมูลเท่านั้นคลิก ปลดล็อกเซลล์ ภายใต้ ออกแบบ จากนั้นคลิกแท็บ OK ปุ่มที่โผล่ขึ้นมา Kutools สำหรับ Excel กล่องโต้ตอบ ดูภาพหน้าจอ:

3 คลิกที่ ป้องกันแผ่นงาน ใต้ปุ่ม ออกแบบ แถบ

4. จากนั้นระบุและปฏิบัติตามรหัสผ่านของคุณในไฟล์ ป้องกันแผ่นงาน และ ยืนยันรหัสผ่าน กล่องโต้ตอบ ดูภาพหน้าจอ:

ตอนนี้แผ่นงานได้รับการป้องกัน และเซลล์ที่ระบุจะได้รับอนุญาตให้ป้อนข้อมูลเท่านั้น

  หากคุณต้องการทดลองใช้ยูทิลิตีนี้ฟรี (30 วัน) กรุณาคลิกเพื่อดาวน์โหลดแล้วไปใช้การดำเนินการตามขั้นตอนข้างต้น


บทความที่เกี่ยวข้อง:

สุดยอดเครื่องมือเพิ่มผลผลิตในสำนักงาน

🤖 Kutools AI ผู้ช่วย: ปฏิวัติการวิเคราะห์ข้อมูลโดยยึดตาม: การดำเนินการที่ชาญฉลาด   |  สร้างรหัส  |  สร้างสูตรที่กำหนดเอง  |  วิเคราะห์ข้อมูลและสร้างแผนภูมิ  |  เรียกใช้ฟังก์ชัน Kutools...
คุณสมบัติยอดนิยม: ค้นหา เน้น หรือระบุรายการที่ซ้ำกัน   |  ลบแถวว่าง   |  รวมคอลัมน์หรือเซลล์โดยไม่สูญเสียข้อมูล   |   รอบโดยไม่มีสูตร ...
การค้นหาขั้นสูง: VLookup หลายเกณฑ์    VLookup หลายค่า  |   VLookup ข้ามหลายแผ่น   |   การค้นหาที่ไม่ชัดเจน ....
รายการแบบเลื่อนลงขั้นสูง: สร้างรายการแบบหล่นลงอย่างรวดเร็ว   |  รายการแบบหล่นลงขึ้นอยู่กับ   |  เลือกหลายรายการแบบหล่นลง ....
ผู้จัดการคอลัมน์: เพิ่มจำนวนคอลัมน์เฉพาะ  |  ย้ายคอลัมน์  |  สลับสถานะการมองเห็นของคอลัมน์ที่ซ่อนอยู่  |  เปรียบเทียบช่วงและคอลัมน์ ...
คุณสมบัติเด่น: กริดโฟกัส   |  มุมมองการออกแบบ   |   บาร์สูตรใหญ่    สมุดงานและตัวจัดการชีต   |  ห้องสมุดทรัพยากร (ข้อความอัตโนมัติ)   |  เลือกวันที่   |  รวมแผ่นงาน   |  เข้ารหัส/ถอดรหัสเซลล์    ส่งอีเมลตามรายการ   |  ซุปเปอร์ฟิลเตอร์   |   ตัวกรองพิเศษ (กรองตัวหนา/ตัวเอียง/ขีดทับ...) ...
ชุดเครื่องมือ 15 อันดับแรก12 ข้อความ เครื่องมือ (เพิ่มข้อความ, ลบอักขระ, ... )   |   50 + แผนภูมิ ประเภท (แผนภูมิ Gantt, ... )   |   40+ ใช้งานได้จริง สูตร (คำนวณอายุตามวันเกิด, ... )   |   19 การแทรก เครื่องมือ (ใส่ QR Code, แทรกรูปภาพจากเส้นทาง, ... )   |   12 การแปลง เครื่องมือ (ตัวเลขเป็นคำ, การแปลงสกุลเงิน, ... )   |   7 ผสานและแยก เครื่องมือ (แถวรวมขั้นสูง, แยกเซลล์, ... )   |   ... และอื่น ๆ

เพิ่มพูนทักษะ Excel ของคุณด้วย Kutools สำหรับ Excel และสัมผัสประสิทธิภาพอย่างที่ไม่เคยมีมาก่อน Kutools สำหรับ Excel เสนอคุณสมบัติขั้นสูงมากกว่า 300 รายการเพื่อเพิ่มประสิทธิภาพและประหยัดเวลา  คลิกที่นี่เพื่อรับคุณสมบัติที่คุณต้องการมากที่สุด...

รายละเอียด


แท็บ Office นำอินเทอร์เฟซแบบแท็บมาที่ Office และทำให้งานของคุณง่ายขึ้นมาก

  • เปิดใช้งานการแก้ไขและอ่านแบบแท็บใน Word, Excel, PowerPoint, ผู้จัดพิมพ์, Access, Visio และโครงการ
  • เปิดและสร้างเอกสารหลายรายการในแท็บใหม่ของหน้าต่างเดียวกันแทนที่จะเป็นในหน้าต่างใหม่
  • เพิ่มประสิทธิภาพการทำงานของคุณ 50% และลดการคลิกเมาส์หลายร้อยครั้งให้คุณทุกวัน!
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