为什么我会遇到VBA Typer不匹配错误?
尝试在我的VBA代码中创建一个有条件的语句,以突出显示C列中的任何小于2的RED。
Set result = Range("C:C").Value
If result < 2 Then
MyRange.Font.ColorIndex = 3
End If
不确定为什么我会遇到类型不匹配错误。
Trying to create a conditional statement in my VBA code for a pivot table to highlight red any values less than 2 in Column C.
Set result = Range("C:C").Value
If result < 2 Then
MyRange.Font.ColorIndex = 3
End If
Not sure why I'm getting a type mismatch error.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我喜欢有条件的格式选项。
否则类似的事情可能会很好地工作:
我还没有检查颜色的实际应用
这应该使您更加接近
I like the conditional formatting option.
otherwise something like this might work well:
I haven't checked the actual application of colour
this should get you a little closer