Hi,
Need VBA (or any other mechanism) to disable Paste from other sources for a selected range.
An excel file attached with necessary details.
Pl. help.
Thanks,
Nagesh.
Hi,
Need VBA (or any other mechanism) to disable Paste from other sources for a selected range.
An excel file attached with necessary details.
Pl. help.
Thanks,
Nagesh.
Aa far as I can ascertain, you cannot determine the source of a copy/paste action.
Last edited by JohnTopley; 03-22-2024 at 05:31 AM.
If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
One solution might be to use a ChangeEvent to check the undo list for a Paste action and also check whether CutCopyMode is False.
If CutCopyMode is False, then the operation is probably not internal.
Please Login or Register to view this content.
Last edited by ByteMarks; 03-22-2024 at 05:25 AM.
@Bytemarks: copying from Sheet2 ("alien" sheet!) to Sheet1, the following worked (if I understand the code) i.e copied data was deleted from Sheet1
Please Login or Register to view this content.
Last edited by JohnTopley; 03-22-2024 at 05:43 AM.
I assumed "other sources" were outside of Excel. If you copy within Excel then you have the marching ants and CutCopyMode is True (1), so the paste should be allowed.
With CutCopyMode to 1 (True) in the code it'll undo if it is internal which is the opposite.
Last edited by ByteMarks; 03-22-2024 at 05:49 AM.
@ByteMarks,
I tried your code but is stopping from pasting data.
@JohnTopley,
Your code is Stopping from Pasting data entirely. But I require the pasting option in the existing Sheet (if not possible to restrict within Sheet, it is OK within the workbook).
Pl. help.
Does this work for you?
All the code is in ThisWorkbook
Please Login or Register to view this content.
Last edited by ByteMarks; 03-22-2024 at 08:48 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks