Protect cells from a user group within a VBA worksheet

HeliRecords

New Member
Joined
Feb 7, 2018
Messages
6
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

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,122
Messages
5,852,269
Members
431,494
Latest member
ilike1664

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