Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Can I lock data into few cells in sheet and clear the rest

Something like:

Option Explicit
Sub testme01()

Dim myCell As Range
Dim myRng As Range

Set myRng = Worksheets("sheet1").UsedRange

For Each myCell In myRng.Cells
If myCell.Locked Then
'skip it
Else
myCell.ClearContents
End If
Next myCell

End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

eabrown wrote:

Using Office 2003, Excel Workbook. I want to enter data into certain cells,
lock them, enter data into the remainder of the sheet and later do a global
"clear contents" which will clear everything EXCEPT the data in the locked
cells. Is this possible?


--

Dave Peterson
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
Help PLEASE! Not sure what answer is: Match? Index? Other? baz Excel Worksheet Functions 7 September 3rd 05 03:47 PM
#REF! help bill gras Excel Worksheet Functions 5 August 22nd 05 11:13 AM
Copy 1 Sheet to Another Dar Excel Worksheet Functions 3 June 6th 05 10:52 PM
need to clear data references in pivot table report Mikeeusa Charts and Charting in Excel 3 April 28th 05 08:57 PM
Multiple worksheet queries liam Excel Worksheet Functions 3 February 16th 05 06:52 PM


All times are GMT +1. The time now is 05:18 PM.

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

About Us

"It's about Microsoft Excel"