Password Protect Worksheet: VBA Code to Protect Worksheet with Password on Close

वर्कशीट को पासवर्ड से सुरक्षित रखने के लिए VBA कोड बंद करें
विषयसूची

Password Protect Worksheet on Close with VBA (with Images)

क्या यह है:

When you want others to only view the workbook data and no editing should be permitted then you have to make sure you protect the workbook with password while closing it. So that even if someone tries to edit the data it will ask for the password unless they input the password data will not be editable.

The manual way of doing the same is

समीक्षाProtect Sheet and then बचाना workbook.

Password Protect

क्यों यह है:

If you make frequent updates in the workbook then Every time when you make changes in the workbook you have to make sure you protect it while closing. Some day if you forget to protect then the data will be editable by others.

The below VBA code will help you to protect the workbook automatically while closing the workbook. That means you don’t have to protect it manually everything when you make changes in the workbook.

कैसे to password protect with VBA upon Close:

Step 1: Open the workbook that need to be protected and press Alt + F11




चरण 2: नीचे दिए गए कोड को VBA संपादक विंडो में कॉपी और पेस्ट करें और कार्यपुस्तिका सहेजें।

निजी सब Workbook_BeforeClose(Cancel As Boolean)

Sheets(“Sheet1″).Protect Password:=”Your Password Here”   ‘Replace “Sheet1” with your sheet name and “Your Password Here” with the password of your choice.

ActiveWorkbook.Save

अंत उप

टिप्पणी: Workbook should be saved in a macro enabled format (.xlm, .xlsm, .xlsb etc.) also make sure you protect the VBA code as well. 🙂

That’s It Now Onward your Data will be Safe Always!!

Picture of Anson Antony
एंसन एंटनी
एंसन एक योगदानकर्ता लेखक और संस्थापक हैं www.askeygeek.com. कुछ भी नया सीखना हमेशा से उनका जुनून रहा है, ASKEYGEEK.com प्रौद्योगिकी और व्यवसाय के प्रति उनके जुनून का परिणाम है। उन्हें बिजनेस प्रोसेस आउटसोर्सिंग, वित्त और लेखा, सूचना प्रौद्योगिकी, परिचालन उत्कृष्टता और बिजनेस इंटेलिजेंस में एक दशक का बहुमुखी अनुभव मिला है। कार्यकाल के दौरान, उन्होंने विभिन्न भूमिकाओं और जिम्मेदारियों में जेनपैक्ट, हेवलेट पैकर्ड, एम*मोडल और कैपजेमिनी जैसे संगठनों के लिए काम किया था। व्यवसाय और प्रौद्योगिकी के अलावा, वह फिल्मों के शौकीन हैं, जो सिनेमा देखने और सीखने में घंटों बिताते हैं और एक फिल्म निर्माता भी हैं!

प्रातिक्रिया दे

आपका ईमेल पता प्रकाशित नहीं किया जाएगा. आवश्यक फ़ील्ड चिह्नित हैं *

बधाई हो!
आपने कर दिखाया,
बंद मत करो!

उठो 60,000 UberTTS कैरेक्टर क्रेडिट निःशुल्क!!!

यह पॉपअप नहीं दिखाएगा आप पर है दोबारा!!!

उबरटीटीएस
Share to...