View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Sam Wilson Sam Wilson is offline
external usenet poster
 
Posts: 523
Default Clear Spreadsheet Field

Or

Sub Macro2()
Dim cell As Range
dim ws as worksheet
for each ws in activeworkbook.worksheets
For Each cell In ws.UsedRange
If Not cell.Locked Then cell.ClearContents
Next cell
next ws

End Sub


"Jacob Skaria" wrote:

Try

Sub Macro2()
Dim cell As Range
For Each cell In ActiveSheet.UsedRange
If Not cell.Locked Then cell.ClearContents
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Glenn" wrote:

Hi,

I would like a bit of VB code that when clicked will clear all unprotected
fields within a workbook.

Many thanks, Glenn