Merging Cells with Styles

I was trying to delete the contents of a cell with the delete key and I got the error:

The cell or chart you are trying to change is protected and therefore read-only.

I know the sheet was protected, but I was certain the cell was unlocked. I was certain because I created a style for data entry cells with a particular background color and the Locked property unchecked. I thought that style had been applied, but I wasn’t quite right. I did apply the style at one point, but I broke it when I merged cells later. As I was finishing up the layout of my form, I realized that I needed to split a couple of columns. I split and resized them, then went back and merged the cells that didn’t require the split. Merging cells with two different styles copied the background color, but not the style, and therefore, not the unlocked property.

The odd thing is that I was able to enter data into the merged cell, I just couldn’t delete it.

I created a style for data entry cells

Then I applied to the cell

I merged that cell with the cell next to it

I could enter text, but when I tried to clear the contents, error.

The style went away. It didn’t revert to Normal. They style box was simply empty.

I reapplied the style and all was well

We all know that merged cells are the devil. There are just some situations where they are unavoidable, in my opinion. This workbook has no VBA in it, so I figured I was safe.

Posted in Uncategorized

Posting code? Use <pre> tags for VBA and <code> tags for inline.

Leave a Reply

Your email address will not be published.