Code:
Dim mRange2 As Excel.Range
Set mRange2 = ActiveSheet.Range("DocID").MergeArea
mRange2.ClearContents
I have a range named 'DocID' and I would like to clear its content.
When I run the code above it does clear the content but then I get this error: Run-time error '1004': We can't do that to a merged cell
I also tried to first unmerge the cells to clear its content. I also would like to merge them again:
Code:
Dim mRange As Excel.Range
Set mRange = src.Range("Descrição").MergeArea
mRange.UnMerge
src.Range("D26").ClearContents
I get a method range objet error.
Last edited by a moderator: