• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Apply this code to specific cells

rjwalters

New Member
I have this code which works great, I just want to go one step farther. This code allows users to clear contents on a protected sheet. I want to keep that function but apply it to a specified range of cells.


C6 thru T130 are the cells that I want to apply this too. This includes Column C -> T,and rows 6 -> 130.


' Sub test()

Dim r As Range

For Each r In ActiveSheet.UsedRange

If Not r.Locked Then

r.ClearContents


End If

Next

End Sub '
 
Hi Walters ,


The part ActiveSheet.UsedRange is the part which defines the range of cells on which the procedure will work ; replace this part with Activesheet.Range("C6:T130") if you want the procedure to work on a specific range of cells.


Narayan
 
That's absolutely incredible , I knew it would be simple for the pros. Thanks so much works like a charm....
 
Back
Top