LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
JB2010
 
Posts: n/a
Default Macro to clear contents of unprotected cells AND drop down boxes

Hi there


I have the following macro which clears the contents of unprotected cells on
a sheet. It stops with the error message "400", however, when it gets to the
drop down boxes on the sheet within the selection.

Here is the macro:



Sub clearunprotectedcells()

Dim cell As Range
Range("A3:I59").Select
For Each cell In Selection
If cell.Locked = False Then
cell.ClearContents
End If
Next
End Sub


Does anybody have a way of modifying the script so it will clear all the
drop down boxes (they are all unprotected, incidentally!) AS WELL AS the
unprotected cells?


any help gratefully recieved. please do not hesitate to contact if you need
more info


cheers


jb

 
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 can cells be drop down boxes and still allow custom text? Rocky Excel Discussion (Misc queries) 1 December 29th 05 10:31 PM
Selecting from a Validation Drop Down Box aborts macro Lreeder Excel Worksheet Functions 0 August 27th 05 01:41 AM
Copy drop down boxes and associate to cells dynamically in excel t Killion Excel Worksheet Functions 2 June 10th 05 03:11 PM
Drop Down Boxes for Validation Cells are Too Wide Geoff Excel Discussion (Misc queries) 1 May 10th 05 08:27 PM
automatic color change in cells using a drop down list kennethwt Excel Worksheet Functions 1 January 21st 05 06:37 PM


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