Excel的查找与替换命令同样对单元格格式(如字体颜色、单元格背景色等)有效,因此可以实现根据格式条件定位符合要求的单元格。下面以Excel 2010为例演示:
将字体为红色的单元格的内容设为0
删除灰色背景单元格所在的行
原始表格
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/dcc451da81cb39db19db74d1d5160924ab183019?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)
打开“查找和替换”对话框
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/ca1349540923dd542166b4efd409b3de9c82481b?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/e850352ac65c10386533dd45b7119313b17e89e3?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)
在“查找和替换”对话框中点击“选项”打开折叠面板。查找内容选择单元格格式,然后选择红色字体的单元格,替换为0,点击“全部替换”
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/b7003af33a87e95006fce0eb15385343faf2b449?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)
此时效果为
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/dcc451da81cb39db186675d1d5160924aa183096?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)
接着演示按条件删除效果,其操作类似前面的步骤
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/728da9773912b31b6c5bd0ae8318367adab4e106?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)
选中符合条件的单元格,右击菜摊选择“删除”→“整行”
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/a1ec08fa513d26975cbe15da50fbb2fb4216d8c3?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)
最终效果如下
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/64380cd7912397dd9f2185835c82b2b7d1a287d8?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)