Function test(aa As Range, bb As Range, cc As Range)
Dim str
If aa.Value > bb.Value Then
str = aa.Value
If str > cc.Value Then
test = str
Else
test = cc.Value
End If
Else
str = bb.Value
If str > cc.Value Then
test = str
Else
test = cc.Value
End If
End If
End Function
Dim str
If aa.Value > bb.Value Then
str = aa.Value
If str > cc.Value Then
test = str
Else
test = cc.Value
End If
Else
str = bb.Value
If str > cc.Value Then
test = str
Else
test = cc.Value
End If
End If
End Function
注意的是要放在模块里,然后做为函数来调用