When I run the following code, a dialog box pops up asking if I want to replace the contents of the destination cells, which I do want to? How can I bypass this dialog box?
Thank YouPlease Login or Register to view this content.
When I run the following code, a dialog box pops up asking if I want to replace the contents of the destination cells, which I do want to? How can I bypass this dialog box?
Thank YouPlease Login or Register to view this content.
Last edited by Aland2929; 05-15-2010 at 11:37 AM.
Try this
Please Login or Register to view this content.
Last edited by Bob@Sun; 05-15-2010 at 10:40 AM.
The logic is that you need to delete the old content before pasting the new one.
When I run this code, it has a problem with the?Please Login or Register to view this content.
If you provide a sample file I will be able to test it and see where the problem is.
If you want to bypass a dialogue box you would add application.DisplayAlerts
When working with an object you do not have to use select or selection, this only slows down the code.
Instead try...
Please Login or Register to view this content.
Why would you copy and then paste in the same plase???
I was thinking another range was selected previouslly and that is where you need to paste.
I can't see why your code doesn't work
However
Please Login or Register to view this content.
Replace "A2" with the position on the sheet that suits you.
The message you get "Do want to replace the contents of the destination cells?"
only appears when you use drag and drop. I don't see why you should get it using copy/pastespecial code
You don't need to copy & paste
Please Login or Register to view this content.
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
Check the code that I posted. Presumably you are converting formulas to values
We are all still learning
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks