ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Clearing a merged cell (https://www.excelbanter.com/excel-programming/271603-clearing-merged-cell.html)

Jon Omar

Clearing a merged cell
 
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").ClearConten ts

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

Dave Peterson[_3_]

Clearing a merged cell
 
I like Bob's method better, but this works, too:

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



Jon Omar wrote:

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").ClearConten ts

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


--

Dave Peterson



All times are GMT +1. The time now is 03:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com