Clear contents of merged cells

Paella1

Active Member
Joined
Mar 10, 2005
Messages
382
Is there a clever way to clear the contents of merged cells without getting "Cannot change part of a merged cell" ?

The only way I can get it to work is by selecting the cell. This offends the coding gods.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Every method will fail unless you target the whole range. There's nothing wrong with changing a merged range; it's part of a merged cell you can't change
 
Upvote 0
The "target" is an offset from a cell that has been changed (the procedure is event triggered, so target is an unfortunate choice of terminology). It may or may not be part of merged range. I am trying to think of a way that will target the entire range if the "target" is merged.
 
Upvote 0
You can do this on any part of a merged cell:-
Code:
Range([I]whatever[/I]).MergeArea.ClearContents
 
Last edited:
Upvote 0
Ruddles, that is magnificent! I shall have your post embroidered on fine lace so I may pass it on to my grandchildren.
 
Upvote 0
I got it from my own dear grandmother in a very similar sort of way!
 
Upvote 0

Forum statistics

Threads
1,217,433
Messages
6,136,601
Members
450,021
Latest member
Jlopez0320

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top