Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Clearing Contents of all "unprotected" Cells.

To the Great and Wise VBA Gurus,

Is there a VBA routine that would "clear contents" out of all th
unprotected cells on a worksheet, that could use the "UsedRange
property so that it could be utilized on worksheets of differin
sizes?

Many thanks in advance
Case

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Clearing Contents of all "unprotected" Cells.

Casey

Try this.....clears contents of unlocked cells on all worksheets.

Adapt to suit.

Sub UnlockedCells()
Dim wk As Worksheet
Dim cl As Range
For Each wk In Worksheets
For Each cl In wk.UsedRange
If cl.Locked = False Then
cl.ClearContents
End If
Next
Next
End Sub

Gord Dibben Excel MVP

On Thu, 5 Aug 2004 17:31:08 -0500, Casey
wrote:

To the Great and Wise VBA Gurus,

Is there a VBA routine that would "clear contents" out of all the
unprotected cells on a worksheet, that could use the "UsedRange"
property so that it could be utilized on worksheets of differing
sizes?

Many thanks in advance
Casey


---
Message posted from http://www.ExcelForum.com/


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Clearing Contents of all "unprotected" Cells.

Gord,
A million thanks, our internet access has been down and I couldn't ge
back here to see if any one had replied. I try not to ask for cod
without a least first trying something on my own. But this was kind o
an emergency and you have made my day. Again, thank you

Case

--
Message posted from http://www.ExcelForum.com

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
"Do you want to replace the contents of the destination cells?" Bob Barnes Excel Discussion (Misc queries) 8 April 2nd 23 08:05 PM
Problems with macro, setting "tab order" of unprotected cells Foxcole Excel Discussion (Misc queries) 2 May 14th 09 09:08 PM
Adding the contents of "x" number of cells. Menochez Excel Worksheet Functions 4 December 15th 08 03:08 AM
how to increase size of "name box" and "contents of cell " displa. Stubby- LIBERTY New Users to Excel 2 February 22nd 07 06:43 PM
Clearing Unprotected Cells Phil Hageman Excel Programming 6 October 10th 03 12:16 PM


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