根据已经在单元格中的内容更改单元格的内容
没有人知道如何更改电子表格中单元格的内容,具体取决于在同一单元格中find的内容,然后使用VBA更改颜色scheme
例如
单元格值= N / A#
新的细胞价值将不会在以前的报告
配色scheme=在黄色背景上的黑色和粗体文本
要么
单元格值=零或单元格没有任何内容,因此是空白的
新的细胞价值将=上一次报告没有提供更新
配色scheme=红色背景上的白色和粗体文本
还有其他单元格的值,这些都是保持不变。
在此先感谢您提供的任何帮助,这是非常感谢
http://www.mrexcel.com/forum/excel-questions/780048-how-do-you-change-contents-cell-depending-what-already-cell.html
select单元格并运行这个:
Sub repair() Dim r As Range For Each r In Selection If r.Text = "#N/A" Then r.Value = "Not On Previous Report" r.Interior.ColorIndex = 27 r.Font.FontStyle = "Bold" End If If r.Value = "" Or r.Value = 0 Then r.Value = "No Update Provided On Previous Report" r.Interior.ColorIndex = 3 r.Font.FontStyle = "Bold" r.Font.ColorIndex = 2 End If Next r End Sub