我想知道如果兩個單元格具有不同的值,是否有辦法顯示評論,例如“=if(A1=B1,“顯示評論”,“顯示評論”),謝謝
uj5u.com熱心網友回復:
Public Function if_then_comment(criteria, ifTrueString As String, _
ifTrueComment As String, ifFalseString As String, ifFalseComment As String)
Dim calcDefault
Application.Volatile
calcDefault = Application.Calculation
Application.Calculation = xlCalculationManual
Application.EnableEvents = False ' => disable events
On Error Resume Next
With Application.ThisCell
If criteria Then
if_then_comment = ifTrueString
.ClearComments
.AddComment (ifTrueComment)
Else
if_then_comment = ifFalseString
.ClearComments
.AddComment (ifFalseComment)
End If
End With
On Error GoTo 0
Application.Calculation = calcDefault
Application.EnableEvents = True ' => enable events
End Function

uj5u.com熱心網友回復:
Try the function below
=IF(A1>B1,"comment",IF(A1<B1,"comment"))
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/434851.html
