Showing posts with label Highlight Editable ranges using VBA. Show all posts
Showing posts with label Highlight Editable ranges using VBA. Show all posts

Sunday, July 25, 2010

Program/Macro to Highlight Editable Ranges in Protected Sheet

How to identify Editable ranges in a protected Excel sheet using VBA

My good friend Srikanth Srinivasan is a Project Manager whom Microsoft will definitely want to hire as evangelist. He uses the functionality of Excel to great extent and made it ubiquitous.

The following code was for him, which highlights the ranges that are not protected in Excel sheet


Sub HighLight_Editable_Ranges()


Dim oWS As Worksheet
Dim oRng As AllowEditRange

Set oWS = ActiveSheet

oWS.Unprotect

For Each oRng In oWS.Protection.AllowEditRanges
oRng.Range.Interior.ColorIndex = 35
Next oRng

oWS.Protect

End Sub

Related Posts Plugin for WordPress, Blogger...
Download Windows Live Toolbar and personalize your Web experience! Add custom buttons to get the information you care about most.