Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / General Excel Questions / May 2008

Tip: Looking for answers? Try searching our database.

How do I delete only the content of cells that are NOT protected?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DrDisk7 - 17 May 2008 04:39 GMT
In a selected range of a partial or whole worksheet, is there a way to clear
the content of the cells which are selected but are NOT protected (or not
marked as "locked" in an unprotected sheet) while keeping all formats and
locked/protected cells in that range untouched. -- Is there a way to disable
the protection error so that the delete/clear command can go and do its job
on the unprotected cells? Even the earliest spreadsheets had it! Is Excel too
restricted?
Gord Dibben - 17 May 2008 16:38 GMT
Sub UnlockedCells()
Dim cl As Range
        For Each cl In ActiveSheet.UsedRange
           If cl.Locked = False Then
               cl.ClearContents
           End If
        Next
End Sub

Gord Dibben  MS Excel MVP

>In a selected range of a partial or whole worksheet, is there a way to clear
>the content of the cells which are selected but are NOT protected (or not
[quoted text clipped - 3 lines]
>on the unprotected cells? Even the earliest spreadsheets had it! Is Excel too
>restricted?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.