Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default How do I delete only the content of cells that are NOT protected?

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?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default How do I delete only the content of cells that are NOT protected?

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

On Fri, 16 May 2008 20:39:00 -0700, DrDisk7
wrote:

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?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to delete part of the content on multiple cells in excel? Luis Excel Discussion (Misc queries) 3 May 17th 23 07:42 PM
How to delete the content of all unlocked cells in a protected she DrDisk7 Excel Discussion (Misc queries) 1 January 8th 08 09:58 AM
DELETE CONTENT ADVISOR??? boyd66 Setting up and Configuration of Excel 1 August 26th 06 05:59 PM
how to delete duplicated content from 2 cells lucent88 Excel Worksheet Functions 2 October 12th 05 10:57 PM
How do you delete one cell from a range of protected cells Cgbilliar Excel Worksheet Functions 2 November 3rd 04 10:42 PM


All times are GMT +1. The time now is 04:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"