Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Protected Worksheets with info that needs to be deleted.

Excell 2003. I have a worksheet that is protected, and people are allowed to
input data in the non-protected cells. Is there any way too highlight the
whole worksheet and delete the information that is in the non-protected cells
with out deleted the formulas in the protected cells?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,355
Default Protected Worksheets with info that needs to be deleted.

Try this

Sub ClearUnlockedCells()
Dim myRange As Range
Dim r As Range
Dim aWS As Worksheet

Set aWS = ActiveSheet

Set myRange = Nothing
For Each r In aWS.UsedRange
If Not r.Locked Then
If myRange Is Nothing Then
Set myRange = r
Else
Set myRange = Union(myRange, r)
End If
End If
Next r

If Not myRange Is Nothing Then
myRange.ClearContents
End If
End Sub
--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"Joe Clark" wrote:

Excell 2003. I have a worksheet that is protected, and people are allowed to
input data in the non-protected cells. Is there any way too highlight the
whole worksheet and delete the information that is in the non-protected cells
with out deleted the formulas in the protected cells?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Protected Worksheets with info that needs to be deleted.

Where do I input this information?

"Joe Clark" wrote:

Excell 2003. I have a worksheet that is protected, and people are allowed to
input data in the non-protected cells. Is there any way too highlight the
whole worksheet and delete the information that is in the non-protected cells
with out deleted the formulas in the protected cells?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,355
Default Protected Worksheets with info that needs to be deleted.

Alt F11
Insert a module
Paste this in.

Barb Reinhardt

"Joe Clark" wrote:

Where do I input this information?

"Joe Clark" wrote:

Excell 2003. I have a worksheet that is protected, and people are allowed to
input data in the non-protected cells. Is there any way too highlight the
whole worksheet and delete the information that is in the non-protected cells
with out deleted the formulas in the protected cells?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Protected Worksheets with info that needs to be deleted.

I posted the info into the module, how do I run the module?

Thanks

"Barb Reinhardt" wrote:

Alt F11
Insert a module
Paste this in.

Barb Reinhardt

"Joe Clark" wrote:

Where do I input this information?

"Joe Clark" wrote:

Excell 2003. I have a worksheet that is protected, and people are allowed to
input data in the non-protected cells. Is there any way too highlight the
whole worksheet and delete the information that is in the non-protected cells
with out deleted the formulas in the protected cells?



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,355
Default Protected Worksheets with info that needs to be deleted.

Select the sheet you want to update. Press F8. Run the macro.

Barb Reinhardt

"Joe Clark" wrote:

I posted the info into the module, how do I run the module?

Thanks

"Barb Reinhardt" wrote:

Alt F11
Insert a module
Paste this in.

Barb Reinhardt

"Joe Clark" wrote:

Where do I input this information?

"Joe Clark" wrote:

Excell 2003. I have a worksheet that is protected, and people are allowed to
input data in the non-protected cells. Is there any way too highlight the
whole worksheet and delete the information that is in the non-protected cells
with out deleted the formulas in the protected cells?

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
Groups and Protected Worksheets - know if protected mjones Excel Discussion (Misc queries) 8 April 25th 08 07:43 PM
protected cells can be deleted?! DannyS Excel Discussion (Misc queries) 7 January 31st 08 05:49 PM
how can worksheets be deleted in Excel? Duffer Excel Worksheet Functions 4 November 26th 07 10:30 PM
How use info in Excel shared worksheets to create new worksheets dkc Excel Worksheet Functions 0 June 28th 07 08:36 PM
how do i get back deleted worksheets? Mr Roy Excel Discussion (Misc queries) 5 February 17th 07 03:42 PM


All times are GMT +1. The time now is 05:52 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"