To start, I am VBA illiterate, so whatever your response, please dumb it down for a 3 year old. Thanks. Make that a 2 year old.
Our office uses an Excel spreadsheet for travel approval. There are tabs for each month so 12 tabs (plus hidden tabs for my admin use)
I have conditional formatting and data validation in each tab. The problem is when travelers copy/paste and drag/drop - it screws up my conditional formatting (and data validation), plus we've had issues with people copying previous travel and not changing the travelers names so we don't know who is actually going on the trip.
I created a message box to show when the spreadsheet it opened that tells people NOT to do any of that, but of course they ignore it.
I've found a code to prevent the copy/paste, so that hurdle is done (I do have a question about that too though). But I've searched online and have found nothing to prevent the drag and drop except to disable it for the entire Excel program. I don't want that. If there is a way to prevent it for only this ONE workbook, that would be great.
However, since I don't think that is possible, I am trying to create a message box that whenever someone DOES execute the drag/drop, and message box appears telling the user this feature isn't allowed.
Ideally a code could be written to then undo whatever the user did by drag/drop.
I hope all that made sense. Again, there are tabs for each month, so whatever the solution, it needs to be applied to them all.
Thank in advance!!
Oh, and about the solution I found to prevent copy/paste.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.CutCopyMode = False
End Sub
This code works great. But I would like to be able to toggle this on and off easily. Is there a way to add key strokes so I could do something like Ctrl + Alt + D (or whatever)? Just a set of key strokes that would turn the above code on and off (because I hate the idea of adding and deleting the code whenever I need to copy and paste).
Thank again.
Bookmarks