Clearing a merged cell

J

Jon Omar

I'm writing a macro that needs to clear the contents of a merged cell.
I've given the cell (range) a name but when i try to execute the
statement;

Sheets("Sheetname").Range("Rangename").ClearContents

I get errormessage;

Cannot change a part of a merged cell.

I've tried naming the cell before and after merging with the same
restults. Help would be very much appreciated.

Jon Omar
 
D

Dave Peterson

I like Bob's method better, but this works, too:

Worksheets("Sheetname").Range("Rangename").Value = ""
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top