View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Chrisso Chrisso is offline
external usenet poster
 
Posts: 110
Default Dealing with merged cells

I have a range name for a cell of MYNAME.

MYNAME started off life just being a single cell and I could do all
sorts of wonderful things to it concisely:

Range("MYNAME").ClearContents
Range("MYNAME").Locked = True

I have now made MYNAME a merged cell that spans two columns (A1:B1).
Now I find for my code to work I have to select the merged cells first
then perform my operations:

Range("MYNAME").Select
Selection.ClearContents
Selection.Locked = True

Is there a way to deal with merged cells so that I can perform the
above operations with just one line of code to make the code easier to
read and follow?

Chrisso