I have protected the sheet with password. But I need to protect/prevent first 10 columns ( A:J) being deleted or inserted with new column by user. Looking for vb code.
Thanks in advance.
I have protected the sheet with password. But I need to protect/prevent first 10 columns ( A:J) being deleted or inserted with new column by user. Looking for vb code.
Thanks in advance.
Follow these steps,
1. Go to the Visual Basic Editor by pressing the keys Alt+F11.
2. From the Project Explorer, double-click over the ThisWorkbook object
3. That will execute an event window for you. At the top of the new code window, you will see the word 'General'. Select the drop down where you see general and select 'Workbook'.
4. You will notice that Excel VBA assumes the Open event. That means whatever code you insert in this procedure will execute automatically when the workbook is opened.
Please Login or Register to view this content.
Keep the above code as it is. Additionally,
Right click on the your working sheet and select 'View code' and paste the below one.
Please Login or Register to view this content.
Last edited by abduljaleel.mca; 08-04-2016 at 08:07 AM.
Jaleel,
Some how we are sync. see attached
Prevent Insert Column.jpg
Siva,
It works perfectly for me here.
I don't understand your point. Please elaborate. Also you could attach a sample workbook to demonstrate your need or problem facing. Make sure your desired results are shown. Remember to desensitize the data.
Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
Last edited by abduljaleel.mca; 08-04-2016 at 10:42 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks