G
Glenn Robertson
Hi,
I have a macro that when pushed it will clear all the info
out of any cell that is un-protected on my worksheet. The
macro works fine until it comes across a merged cell then
I get the following error message :-
Run-time error '1004':
Cannot change part of a merged cell.
My macro is as follows :-
Sub test()
Dim cell As Range
For Each cell In ActiveSheet.UsedRange
If cell.Locked = False Then cell.ClearContents
Next
End Sub
Can anybody help ?
I have a macro that when pushed it will clear all the info
out of any cell that is un-protected on my worksheet. The
macro works fine until it comes across a merged cell then
I get the following error message :-
Run-time error '1004':
Cannot change part of a merged cell.
My macro is as follows :-
Sub test()
Dim cell As Range
For Each cell In ActiveSheet.UsedRange
If cell.Locked = False Then cell.ClearContents
Next
End Sub
Can anybody help ?