Dominic,
I tried this method in a similar situation to Dan's. It works (from the
same worksheet), but the formatting of the unlocked cells is removed as well.
Is there a way to keep the formatting?
Also, I'm trying to run the code in a macro located on a differnet sheet.
When I run the macro, I get a "Select Method of Range Class Failed" error.
When I run the debugger the line selecting the cells I want to clear is
highlighted. It's just a simple "range("I2:AR142")" statement. I can't
figure why.
Any ideas?
Thanks
Kurt
this is the macro.....
Sub clear()
Sheets("Payroll - Collections - Pledges").Select
ActiveSheet.Unprotect Password:=Password
Range("C1:AR142").Select <-RIGHT HERE IS WHERE IT HANGS!
Count = 0
On Error Resume Next
For Each RNG In Selection
If RNG.Locked = False Then
Count = Count + 1
If Count = 1 Then Set Unlocked = RNG
If Count <> 1 Then Set Unlocked = Union(Unlocked, RNG)
End If
Next RNG
Unlocked.clear <-NEED FORMATTING TO STAY!
ActiveSheet.Protect Password:=Password
Application.ScreenUpdating = True
End Sub