Protect cells from a user group within a VBA worksheet

HeliRecords

New Member
Joined
Feb 7, 2018
Messages
5
Can someone please tell me what the easiest way to do the following within a work sheet.
1. Password protect sheet
2. Pull information from website with a VBA when sheet is updated
3. Allow all cells to be formatted without having to enter password for user group "Records-Staff"
4. Allow the data in only certain cells to be changed without password for user group "Records-Staff"
5. Allow cells to be formatted and updated without password for user group "Records-Admin"

Right now I am using a combination of Allow Users to Edit Ranges & VBA. Everything is working except the user group "Records-Admin" still has to enter a password to change data in cell. This may be the easiest way to do it but I just wanted to ask. I have added the VBA I am using along with a copy of part of the worksheet for reference. Thanks in advance for any help!!

Sub UpdateWebQuery()
'
' UpdateWebQuery Macro
'
ActiveSheet.Unprotect "helidrafter"

ActiveWorkbook.RefreshAll
ActiveSheet.Protect "helidrafter", AllowFormattingCells:=True, AllowFormattingRows:=True

End Sub

1617809124440.png
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Watch MrExcel Video

Forum statistics

Threads
1,129,591
Messages
5,637,288
Members
416,963
Latest member
samfuge

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
Top