ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Making VB PasteSpecial method to work the same as Excels Application (https://www.excelbanter.com/excel-programming/271222-making-vbulletin-pastespecial-method-work-same-excels-application.html)

John[_35_]

Making VB PasteSpecial method to work the same as Excels Application
 
I am using the following code to paste data in my worksheet
Selection.PasteSpecial Paste:=xlValues
When I use this method the undo button became disabled, so I cannot be
able to undo the pasting.
If I use the Excel's PasteSpecial command the undo button is enabled
and I can be able to undo the changes.

How can I make the undo button be enabled so that I can undo the paste
done using PasteSpecial method?

Thank you
John

John[_35_]

Making VB PasteSpecial method to work the same as Excels Application
 
Thanks Trevor for your answer.
I had a problem with pasting and validation, thats why I decided to
use VBA PasteSpecial, so that I only paste values and not validation.
I have now put code to reset validation in WorkSheet_Change procedure.
But the Undo and Repeat buttons are showing the word "validation" in
their lists
How do I remove this word "validation" from the list.

Thanks

John


"Trevor Shuttleworth" wrote in message ...
John

bad news I'm afraid. Most, if not all VBA code clears the Undo stack.
There is nothing that can be done about this unless you want to create your
own stack.

Regards

Trevor


"John" wrote in message
om...
I am using the following code to paste data in my worksheet
Selection.PasteSpecial Paste:=xlValues
When I use this method the undo button became disabled, so I cannot be
able to undo the pasting.
If I use the Excel's PasteSpecial command the undo button is enabled
and I can be able to undo the changes.

How can I make the undo button be enabled so that I can undo the paste
done using PasteSpecial method?

Thank you
John



All times are GMT +1. The time now is 05:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com