简体   繁体   English

保护单元格或范围的条件格式

[英]Protecting conditional formatting of a cell or range

I want that even if a user paste some data using (cntrl + V) or (right click + paste), only values should be pasted, Conditional formatting should not be changed.我希望即使用户使用(cntrl + V)或(右键单击+粘贴)粘贴一些数据,也应该只粘贴值,不应该更改条件格式。

I tried this method https://www.extendoffice.com/documents/excel/1277-excel-protect-format.html我试过这个方法https://www.extendoffice.com/documents/excel/1277-excel-protect-format.html

but it is protecting data validation only (drop down menu) but color fill formatting is changing if some data is pasted using ( ctrl + V ) or (right click + paste).但它仅保护数据验证(下拉菜单),但如果使用( ctrl + V )或(右键单击 + 粘贴)粘贴某些数据,颜色填充格式会发生变化。 if excel does not include this function suggest some VBA code.如果 excel 不包括此 function 建议一些 VBA 代码。

This is not what you want to hear, but protecting only the conditional formatting of cells - while allowing entering data - is virtually impossible.这不是您想听到的,但仅保护单元格的条件格式 - 同时允许输入数据 - 几乎是不可能的。

Excel does not have this functionality built-in, so you would need code. Excel 没有内置此功能,因此您需要代码。 But there are many different ways that cells can be overwritten -- ie keyboard shortcuts, ribbon commands, context menus, vba, -- and while writing code to intercept these changes is not possible, code to undo these changes is a very complex beast to write as well.但是有许多不同的方式可以覆盖单元格——即键盘快捷键、功能区命令、上下文菜单、vba——虽然编写代码来拦截这些更改是不可能的,但撤消这些更改的代码是一个非常复杂的野兽。也写。

You may want to educate your users to paste values only.您可能希望教育您的用户仅粘贴值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM