Allow Users to Edit Ranges

Pinaceous

Well-known Member
Joined
Jun 11, 2014
Messages
1,113
Office Version
  1. 365
Platform
  1. Windows
Good Day All,


Is there a way to produce the "Allow Users to Edit Ranges" status icon as depicted in the picture below through shortcut keyboard typing or vba?

The reason why I'm asking is because I've modified my ribbon and did not want to undo it to accomplish this particular task.


Please let me know.

Thank you!
pinaceous


1700023302079.png
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
You could add it to the Quick Access Toolbar or use Alt-R-U-1 (you don't have to hold them all down, just press them in order).
 
Upvote 0
Hi NateSC,

Wow, that really helps so much! Let me give it a go!

Thanks!
Pinaceous
 
Upvote 0
Hi NateSC,

The Alt-R-U-1 does pull up the "Allow Users to Edit Ranges" status icon but in my case since I have the ribbon blocked it does not work upon my sheet.

Do you have a vba suggestion to pull up that icon?

Please let me know.

Thank you!

Respectfully,
pinaceous
 
Upvote 0
Would something like this work?
VBA Code:
Sub AllowEdit()
Dim wb As Workbook, sht As Worksheet, rng As Range
Set wb = ThisWorkbook: Set sht = wb.Sheets(1)
Set rng = sht.Range("A1:E5")
sht.Protection.AllowEditRanges.Add "User Editable", rng, "Password"
End Sub
 
Upvote 0
Hey Skyybot,

That did change the Allowable Edit Ranges and I appreciate that!

I noticed that it cannot be run twice because it cannot replace what is there.

Do you know if there is a way to delete any existing ranges, if they are present upon that sheet?

Thank you!
pinaceous
 
Upvote 0
VBA Code:
Sub DeleteAllowEditRanges()
Dim wb As Workbook, sht As Worksheet, i As Integer, x As Integer
Set wb = ThisWorkbook: Set sht = wb.Sheets(1)
i = sht.Protection.AllowEditRanges.Count
For x = 1 To i
    sht.Protection.AllowEditRanges(x).Delete
Next x
End Sub
 
Upvote 1
VBA Code:
Sub DeleteAllowEditRanges()
Dim wb As Workbook, sht As Worksheet, i As Integer, x As Integer
Set wb = ThisWorkbook: Set sht = wb.Sheets(1)
i = sht.Protection.AllowEditRanges.Count
For x = 1 To i
    sht.Protection.AllowEditRanges(x).Delete
Next x
End Sub
Thank you so much Skyybot!
 
Upvote 0

Forum statistics

Threads
1,215,086
Messages
6,123,035
Members
449,092
Latest member
ikke

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