Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Excel VBA Paste Special - replace contents of destination cells

Hi All,

I'm using Paste Special in a Macro to copy the format and column widths etc
and overwrite some existing data in the destination cells.

Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

I receive an Information Alert message: "Do you want to replace the contents
of the destination cells? Yes / No"

How can I reply "Yes" to the Alert Message within the Macro to prevent user
intervention?

Thanks
Sam

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200604/1
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Excel VBA Paste Special - replace contents of destination cells

Sam,
You can't reply to it, but you can use the following to prevent
the message from appearing...

Application.DisplayAlerts = False

Set this back to True before exiting the Sub.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Sam via OfficeKB.com" <u4102@uwe
wrote in message news:5ee08e4c8ec2e@uwe...
Hi All,
I'm using Paste Special in a Macro to copy the format and column widths etc
and overwrite some existing data in the destination cells.

Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

I receive an Information Alert message: "Do you want to replace the contents
of the destination cells? Yes / No"
How can I reply "Yes" to the Alert Message within the Macro to prevent user
intervention?
Thanks
Sam
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Excel VBA Paste Special - replace contents of destination cells

Hi Jim,

Thank you very much for your assistance: that worked Great!

Cheers
Sam

Jim Cone wrote:
Sam,
You can't reply to it, but you can use the following to prevent
the message from appearing...


Application.DisplayAlerts = False


Set this back to True before exiting the Sub.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200604/1
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
"Do you want to replace the contents of the destination cells?" Bob Barnes Excel Discussion (Misc queries) 8 April 2nd 23 08:05 PM
Do you want to replace the destination cells? Martin ©¿©¬ @nohere.net Excel Discussion (Misc queries) 5 November 20th 09 05:43 AM
Paste contents, but keep formula of destination cynteeuh Excel Discussion (Misc queries) 2 November 19th 09 10:38 PM
Macro causes "Do you want to replace the contents of the destination cells" JB[_2_] Excel Programming 1 October 16th 04 11:25 PM
Replace destination cells SmilingPolitely Excel Programming 3 April 18th 04 08:06 AM


All times are GMT +1. The time now is 11:15 AM.

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

About Us

"It's about Microsoft Excel"