条件格式设置即使在打印时也可以隐藏单元格内容
我想设置一个条件格式设置,如果单元格的内容等于另一个单元格,该设置将隐藏内容(单元格应该看起来为空白)。有谁知道有一个函数可以做到这一点?我尝试使字体与背景颜色相同(在本例中为灰色),但不幸的是,当打印时,文本中留下了某种残留阴影。
这是当我对灰色进行灰色处理时发生的情况(它们应该是相同的颜色):
I我在 Mac 上使用 Excel 2008。
I would like to set up a conditional formatting setting that would hide the contents (the cell should look blank) if the cell's contents is equal to another cell. Does anyone know of a function to do this? I tried just making the font the same color as the background (gray, in this case), but unfortunately when this is printed, there is some sort of residue shadow left over from the text.
Here is what happens when I do gray on gray (they are supposedly the same color):
I am using Excel 2008 on the Mac.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
下面的 A2 中我们有条件格式,如果该单元格的内容等于 B2,则隐藏该单元格的内容。
在条件格式中创建以下规则:
=$A$2=$B$2
,然后按格式...Below in A2 we have the conditional formatting that hides the content of that cell if it is equal to B2.
In Conditional Formatting create the following rule:
=$A$2=$B$2
, then press Format...解决这个问题的另一种方法是一种破解,但它应该可行:
if(dataCell=matchCell, "", dataCell)
another way around this is a hack but it should work:
if(dataCell=matchCell, "", dataCell)
我怀疑打印问题与其说是Excel的问题,不如说是打印机的一个功能。
打印机制造商显然希望在打印页面上获得“最佳”结果。有些人会通过做一些事情来优化颜色,例如使较小的印刷量(例如图表和线条)稍微暗一点,大面积(例如单元格背景稍微亮一点)。这样,当它们并排放置时,它们看起来颜色相同。然而,当根据您的情况相互打印时,您会得到残留效果。
这源于一个众所周知的效应,即对于任何给定的颜色,该颜色的大面积看起来会比完全相同颜色的小区域看起来更暗。还有其他效果可以产生这种错觉,例如背景和附近的颜色。举个例子 - 这与你的不完全相同 - 但说明了这种错觉,请在网上搜索“阿德尔森棋盘”并阅读解释。
无论如何,mpalanco 提出的解决方案(使用三个分号的条件格式)是实现干净结果的最简单方法 - 每次都打印到纸上、打印到 pdf 上、在屏幕上和任何其他形式上。
I suspect that the printing problem is not so much a problem with Excel, but a feature of the printer.
Printer manufacturers obviously want to get the "best" result that they can on a printed page. Some will optimise colour by doing things like making smaller volumes of print (e.g. charters and lines) a bit darker and large areas (e.g. cell backgrounds a bit lighter). This is so that when they are side-by-side they look like the same colour. However, when printed on top of one another as per your case, you get a residual effect.
This stems from a well known effect that for any given colour, a large area of that colour will look darker than a small area of the exact same colour. There are other effects that give this illusion - such as the background and nearby colours. For an example - that is not exactly the same as yours - but illustrates the illusion, search the web for "adelson's checkerboard" and read the explanations.
In any event, the solution proposed by mpalanco (use conditional formatting of three semi-colons) is the easiest way to achieve clean result - every time, printed to paper, printed to pdf, on screen and any other form.
您正走在解决这个问题的正确道路上。您只需将字体颜色设置为白色,除非纸张不是白色,否则打印在纸张上时不会显示该值。我已经使用 Office 2007 完成了此操作。
You are on right track to resolve this. You just need to make the font color white this will not show the value when printed on paper unless the paper is not white. I have done this with Office 2007.
所以我认为为了获得您想要的效果,您需要使用宏来检查单元格的内容。 worksheet_change 事件应该可以正常工作。
为了使此代码正常运行,我需要您告诉我应隐藏其值的单元格范围,以及我们要检查值的单元格范围。
http://www.extendoffice.com/documents/excel /919-excel-hide-cell-contents.html
http://www.ozgrid.com/VBA/run-macros-change.htm" rel="nofollow">http:// /www.ozgrid.com/VBA/run-macros-change.htm
So I think that to get the effect that you would like, you will need to use a macro to check the contents of the cell. A worksheet_change event should work well.
To get this code functional, I will need you to tell me the range of cells whose values should be hidden, and the range of cells that we are checking the values against.
http://www.extendoffice.com/documents/excel/919-excel-hide-cell-contents.html
http://www.ozgrid.com/VBA/run-macros-change.htm