比较格式化的两个单元格

时间:2017-01-30 15:51:53

标签: excel excel-vba vba

我被要求从工作簿中删除单行 UDF(),以便于将工作簿移动到无宏环境。 UDF()将两个单元格“格式化”:

Public Function fEXACT(r1 As Range, r2 As Range) As Boolean
    fEXACT = (r1.Text = r2.Text)
End Function

enter image description here

我不关心字体,对齐等。如果重要,目标环境将是Excel 365.不会:

=D3=E3
=EXACT(D3,E3)

的工作。是否有 UDF() ??

的公式替换

1 个答案:

答案 0 :(得分:6)

你可以试试这个:

=AND(EXACT(D3,E3),CELL("format",D3)=CELL("format",E3))

enter image description here

相关问题