Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-03-2012, 02:58 PM
mrmagoo mrmagoo is offline Clearing a sheet Windows 7 64bit Clearing a sheet Office 2010 32bit
Novice
Clearing a sheet
 
Join Date: Jun 2012
Posts: 19
mrmagoo is on a distinguished road
Default Clearing a sheet


I need to be able to quickly clear data fields on a worksheet. How do I do that?

Excel 2010
Reply With Quote
  #2  
Old 07-04-2012, 06:38 PM
grizz grizz is offline Clearing a sheet Windows XP Clearing a sheet 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
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
sheet 2 data highlight in sheet 1 gsrikanth Excel 1 04-21-2012 06:25 PM
styles ‒ clearing local overrides eNGiNe Word 1 03-01-2012 08:15 AM
Clearing a sheet Construct a summary sheet by summing up from one or more than one sheet. PRADEEPB270 Excel 1 11-04-2011 03:46 AM
copy cell from sheet 2 to sheet 3 macro slipperyjim Excel Programming 1 02-18-2010 01:31 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:02 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft