security using VBA

bloodmilksky

Board Regular
Joined
Feb 3, 2016
Messages
202
Good Morning Guys,

I was just wondering if anyone knew of some code that I could enter into my workbook that would stop modifications from happening to anything other than 2 cells that are used for searching data?

Many thanks

bloodmilksky ^_^
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hi,

If I understand, you don't need code...

From Cell Formatting, make certain all cells containing formulas are marked "Hidden", all cells are marked "Locked" EXCEPT for the 2 cells you want user input. PROTECT the Sheet(s), PROTECT the Workbook, PROTECT your VBA Project.
 
Last edited:
Upvote 0
Good evening,
you can select the entire sheet, right click, format cells, protection, check locked. then select the 2 cells, uncheck the lock. then go to review in the menu click protect sheet under changes group, and click ok.
 
Last edited:
Upvote 0
Hi,

I have tried both methods and both stop the Code From running that I have on the workbook.

Many thanks

jamie
 
Upvote 0
If you have code running on protected sheets, within your code, set:

Code:
UserInterfaceOnly:=True
 
Upvote 0
Hi,

I have tried both methods and both stop the Code From running that I have on the workbook.

Many thanks

jamie
Two options:

1. Have your code unprotect the sheet before it does its work and then re-protect the sheet at the end.

2. Protect the sheet "UserInterfaceOnly". See here for example & a little more info.
 
Upvote 0

Forum statistics

Threads
1,216,156
Messages
6,129,188
Members
449,492
Latest member
steveg127

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top