ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   problem: when paste = validations lost = excel corrupted ! (https://www.excelbanter.com/excel-programming/330924-problem-when-paste-%3D-validations-lost-%3D-excel-corrupted.html)

stt_d31

problem: when paste = validations lost = excel corrupted !
 

hello,

I made an excel worksheet for out customers.

First everything went ok, but now they have a guy who does constantly
paste from other worksheets. The problem is on our excel sheet, several
columns have validations and when the user copys cells from other
sheets, excel also copies the validation.
= this has made our excel sheet corrupted already several times and we
needed to deliver the original one.

I told him so much: you must do: "paste values" instead of just
"paste", but i think he just likes teasing us.

so, now I'm thinking: isn't there a way in excel to do the following:
- disable all normal exel paste functionality (ctrl V, toobar, menu)
- only allow "paste values" in menubar and toolbar.
- when users do ctrl V: excel does immediately paste values instead of
normal paste.

since i'm not really an excel expert, i hope those three things are
possible. if i need to do some VBA programming, no problems.

thanks in advance


--
stt_d31
------------------------------------------------------------------------
stt_d31's Profile: http://www.excelforum.com/member.php...o&userid=24040
View this thread: http://www.excelforum.com/showthread...hreadid=376492


stt_d31[_2_]

problem: when paste = validations lost = excel corrupted !
 

i found this already and it works fine, but I'm more looking for the
following:
- set "paste values" by default instead of normal paste?
- disallow normal paste, but allow "paste values".
- when user does ctrl V: excel does automatically "paste values"?


Code:
--------------------


Private Sub CommandButton1_Click()
' Add this code in the Workbook_Activate event
' it will load every time the workbook is activated

' Turn off the menu
Application.CommandBars("Edit").Controls(3).Enable d = False
Application.CommandBars("Edit").Controls(4).Enable d = False 'copy
Application.CommandBars("Edit").Controls(5).Enable d = False
Application.CommandBars("Edit").Controls(6).Enable d = False
' Turn off the toolbar:
Application.CommandBars("Standard").Controls(7).En abled = False
Application.CommandBars("Standard").Controls(8).En abled = False
'Application.CommandBars("Standard").Controls(9).E nabled = False 'copy
Application.CommandBars("Standard").Controls(10).E nabled = False
' turn off shortcutkeys:
'Application.OnKey "^c", ""
Application.OnKey "^v", ""
Application.OnKey "^x", ""
End Sub

Private Sub CommandButton2_Click()
' Add this code in the Workbook_Activate event
' it will load every time the workbook is de-activated

' Enable the menu:
Application.CommandBars("Edit").Controls(3).Enable d = True
Application.CommandBars("Edit").Controls(4).Enable d = True
Application.CommandBars("Edit").Controls(5).Enable d = True
Application.CommandBars("Edit").Controls(6).Enable d = True
' Enable the commandbar:
Application.CommandBars("Standard").Controls(7).En abled = True
Application.CommandBars("Standard").Controls(8).En abled = True
Application.CommandBars("Standard").Controls(9).En abled = True
Application.CommandBars("Standard").Controls(10).E nabled = True
' Enable the shortcut keys:
Application.OnKey "^c"
Application.OnKey "^v"
Application.OnKey "^x"
End Sub


--------------------


--
stt_d31
------------------------------------------------------------------------
stt_d31's Profile: http://www.excelforum.com/member.php...o&userid=24040
View this thread: http://www.excelforum.com/showthread...hreadid=376492



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

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