excel vba中这条代码出错,怎么改?

If nJs1 = nJs2 = nJs3 = nJs4 = nJs5 = nJs6 Then .Interior.Color = 255: .Offset(0, 1).Value = "是"
2024-12-15 17:05:03
推荐回答(2个)
回答1:

If nJs1 = nJs2 and nJs1 = nJs3 and nJs1 = nJs4 and nJs1 = nJs5 and nJs1 = nJs6 Then
这里没有单元格地址,也就是你要给哪个单元格填充颜色 .Interior.Color = 255: 这里也没有单元格地址 .Offset(0, 1).Value = "是"

回答2:

这是数学表达式,不是 VB 表达式!
试试看这样改:
If (nJs1 = nJs2) And (nJs1 = nJs3) And (nJs1 = nJs4) And (nJs1 = nJs5) And (nJs1 = nJs6) Then
……