Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Clear contents of unprotected cells in entire workbook with a macr

I am trying to write a macro that will clear the contents of all unprotected
cells for an entire workbook. How would I do this without giving the
absolute cell reference for each of the unprotected cells I want to clear?
(I found samples of code that will clear unprotected cells on the active
worksheet only but haven't been able to figure out how to apply this to all
sheet in the entire workbook.
--
Finn Girl
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Clear contents of unprotected cells in entire workbook with a macr

Dim sh as Worksheet
Dim sh1 as Worksheet
Dim rng as Range
Application.ScreenUpdating = False
set sh1 = ActiveSheet
set rng = selection
for each sh in ActiveWorkbook.worksheets
sh.Activate
' code to clear unprotected cells on the active sheet
Next
Sh1.Activate
rng.Select
Application.ScreenUpdating = True

--
Regards,
Tom Ogilvy

"FinnGirl" wrote in message
...
I am trying to write a macro that will clear the contents of all

unprotected
cells for an entire workbook. How would I do this without giving the
absolute cell reference for each of the unprotected cells I want to clear?
(I found samples of code that will clear unprotected cells on the active
worksheet only but haven't been able to figure out how to apply this to

all
sheet in the entire workbook.
--
Finn Girl



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
How do I clear contents in my workbook w/o loosing my formulas? Julie E Excel Worksheet Functions 4 December 29th 06 07:56 PM
Macro to clear contents of unprotected cells AND drop down boxes JB2010 Excel Discussion (Misc queries) 3 March 30th 06 10:13 AM
clear contents cells of unprotected cells Ed Excel Programming 6 January 12th 06 06:09 PM
How do I delete the contents of unprotected cells only? Dan Excel Discussion (Misc queries) 3 August 8th 05 08:18 PM
Delete contents of unprotected cells in workbook BD7447 Excel Worksheet Functions 1 November 6th 04 05:41 PM


All times are GMT +1. The time now is 11:20 AM.

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"