View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default How to suppress the prompt from merging cells

Another approach

Dim rng as Range, vVal as Variant
set rng = Range("A1:B9")
vVal = rng(1).Value
rng.clearContents
rng(1).value = vVal
rng.merge

--
Regards,
Tom Ogilvy


"Shue-Fen KIng" wrote in message
...
I am writing a macro to merge adjacent cells that have the
same values in the header row. But every merge prompts
the following message:

The selection contains multiple data values. Merging into
one cell will keep the upper-left most data only.

The choice is OK or Cancel.

What is the command to suppress this message and take OK
as default? Thanks.

Regards,
Shue-Fen