Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to suppress the prompt from merging cells

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default How to suppress the prompt from merging cells

Use

Application.displayalerts = false

to suppress alerts. Be sure to set back to true as it will remain false
after the macro quits. Then alerts like closing a file without saving will
not appear.

Robert Flanagan
Macro Systems
Delaware, U.S. 302-234-9857
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"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



  #3   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How suppress chart points - cells with formulae returning null sarcastix Charts and Charting in Excel 2 October 20th 08 12:50 AM
Suppress Update Links Prompt Brent E Excel Discussion (Misc queries) 2 October 16th 08 10:56 PM
Pivot Table -- Suppress blank cells Bharath Rajamani Excel Discussion (Misc queries) 1 October 8th 06 08:02 PM
suppress duplicate leading cells Prema Excel Discussion (Misc queries) 2 March 28th 06 01:26 PM
Can I suppress the text in Excel an just print the cells I want t Luis Dominguez Excel Discussion (Misc queries) 0 November 9th 05 08:10 PM


All times are GMT +1. The time now is 12:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"