Thread: [Solved] Clearing a sheet
View Single Post
 
Old 07-04-2012, 06:38 PM
grizz grizz is offline Windows XP Office 2003
Novice
 
Join Date: Jan 2012
Posts: 28
grizz is on a distinguished road
Default

if you create a button then unprotect all cells you want to clear then add a macros that when button presses all unprotected cells will clear --- If this will work for you use this macros
Code:
Option Explicit
Sub Button1_Click()
    Dim rClear As Range
    Dim rCl As Range
    For Each rCl In ActiveSheet.UsedRange
        If Not rCl.Locked = True Then
            If rClear Is Nothing Then
                Set rClear = rCl
            Else: Set rClear = Union(rCl, rClear)
            End If
        End If
    Next rCl
    rClear.ClearContents
End Sub
Reply With Quote