View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Deleting contents from merged cells from VBA

try:

Range("range1").value = ""
or
Range("range1").mergearea.ClearContents

AVR wrote:

I have named 2 merged cells in a spreadsheet, say A1 & B1. The merged cell
is named "range1". I am trying to clear the contents from VBA code, using:
Range("range1").ClearContents
I get an error that says "Cannot change part of a merged cell"
Is there a simple workaround?
Assume I only know the range name and not the component cells.

Thanks


--

Dave Peterson